Skip to Content
0
Former Member
Mar 27, 2009 at 04:53 PM

passing BAPI inside loop of internal table

466 Views

Hi,

My internal table has follwing entries and now I should create 3 documents using BAPI.

How do i do this?

job	 Phase	   Quantity
100       9700      60
100       9700      90
**************
200       9500      10
200       9500      20
200       9600      10
200       9600      70
*************
300       9800      30
300       9800      80
300       9900      20
300       9900      50

wa_header is always

wa_header-co_area = 1000.
      wa_header-docdate = sy-datum.
      wa_header-username = sy-uname.

doc_items -1 -  

100       9700      60
100       9700      90

doc_items -2-

200       9500      10
200       9500      20
200       9600      10
200       9600      70

....


 CALL FUNCTION 'BAPI_ACC_STAT_KEY_FIG_POST'
        EXPORTING
          doc_header            = wa_header
         ignore_warnings       = 'X'
        TABLES
          doc_items             = doc_items
          return                = return