Monday 24 June 2024

SAP Program to fetch four fields from standard table sbook and showing only field carrid in smartform upto 10 rows

Program: 


 Program: 


REPORT ZSM_SMART_REPORT.


TYPES: BEGIN OF str,

  carrid type sbook-carrid,

  bookid TYPE sbook-bookid,

  customid TYPE sbook-customid,

  custtype TYPE sbook-custtype,

  END OF str.


  DATA: it TYPE STANDARD TABLE OF str,

        wa TYPE str.


select carrid bookid customid custtype from sbook into table it UP TO 10 rows.


  CALL FUNCTION '/1BCDWB/SF00000486'

*  EXPORTING

*     ARCHIVE_INDEX              =

*     ARCHIVE_INDEX_TAB          =

*     ARCHIVE_PARAMETERS         =

*     CONTROL_PARAMETERS         =

*     MAIL_APPL_OBJ              =

*     MAIL_RECIPIENT             =

*     MAIL_SENDER                =

*     OUTPUT_OPTIONS             =

*     USER_SETTINGS              = 'X'

*   IMPORTING

*     DOCUMENT_OUTPUT_INFO       =

*     JOB_OUTPUT_INFO            =

*     JOB_OUTPUT_OPTIONS         =

    TABLES

      it_smart_rec               = it

   EXCEPTIONS

     FORMATTING_ERROR           = 1

     INTERNAL_ERROR             = 2

     SEND_ERROR                 = 3

     USER_CANCELED              = 4

     OTHERS                     = 5

            .

  IF sy-subrc <> 0.

* Implement suitable error handling here

  ENDIF.


Output: 


                                 


No comments:

Post a Comment