‎2012 Sep 04 11:24 PM
I been doing a BDC recording for transaction VKM4, with transaction SHDB.
After the selection is done I end up with several rows, which are all selected and processed (I click on diskette to save).
But if I do this from the program only the first row gets processed.
How can I modify the following code so all the rows are selected? or should I add a loop so it just does all the selection process everytime?
This is an example of the code I have:
report ZBDC_MRP7
no standard page heading line-size 255.
include bdcrecx1.
start-of-selection.
perform open_group.
perform bdc_dynpro using 'RVKRED01' '1000'.
perform bdc_field using 'BDC_CURSOR'
'KNKLI-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=ONLI'.
perform bdc_field using 'KKBER-LOW'
'1000'.
perform bdc_field using 'KNKLI-LOW'
'101063'.
perform bdc_field using 'GBSTK-LOW'
'A'.
perform bdc_field using 'GBSTK-HIGH'
'B'.
perform bdc_field using 'ORDER'
'X'.
perform bdc_field using 'DELIV'
'X'.
perform bdc_field using 'P_VARI'
'MRP'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'02/54'.
perform bdc_field using 'BDC_OKCODE'
'=&IC1'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'02/54'.
perform bdc_field using 'BDC_OKCODE'
'=&ILT'.
perform bdc_dynpro using 'SAPLSSEL' '1104'.
perform bdc_field using 'BDC_OKCODE'
'=%00411050000707020'.
perform bdc_field using 'BDC_CURSOR'
'%%DYN001-LOW'.
perform bdc_dynpro using 'SAPLALDB' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=ACPT'.
perform bdc_field using 'BDC_CURSOR'
'RSCSEL-SLOW_I(02)'.
perform bdc_field using 'RSCSEL-SLOW_I(01)'
'C'.
perform bdc_field using 'RSCSEL-SLOW_I(02)'
'J'.
perform bdc_field using 'RSCSEL-SLOW_I(03)'
''.
perform bdc_field using 'RSCSEL-SLOW_I(04)'
''.
perform bdc_field using 'RSCSEL-SLOW_I(05)'
''.
perform bdc_field using 'RSCSEL-SLOW_I(06)'
''.
perform bdc_field using 'RSCSEL-SLOW_I(07)'
''.
perform bdc_field using 'RSCSEL-SLOW_I(08)'
''.
perform bdc_dynpro using 'SAPLSSEL' '1104'.
perform bdc_field using 'BDC_OKCODE'
'=CRET'.
perform bdc_field using 'BDC_CURSOR'
'%%DYN001-LOW'.
perform bdc_field using '%%DYN001-LOW'
'C'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'02/45'.
perform bdc_field using 'BDC_OKCODE'
'=&IC1'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'02/45'.
perform bdc_field using 'BDC_OKCODE'
'=&ILT'.
perform bdc_dynpro using 'SAPLSSEL' '1104'.
perform bdc_field using 'BDC_OKCODE'
'=NONE'.
perform bdc_field using 'BDC_CURSOR'
'%%DYN001-LOW'.
perform bdc_field using '%%DYN001-LOW'
'09/01/2012'.
perform bdc_field using '%%DYN002-LOW'
'C'.
perform bdc_dynpro using 'SAPLSSEL' '1104'.
perform bdc_field using 'BDC_OKCODE'
'=OPTI'.
perform bdc_field using 'BDC_CURSOR'
'%%DYN001-LOW'.
perform bdc_field using '%%DYN001-LOW'
'09/01/2012'.
perform bdc_field using '%%DYN002-LOW'
'C'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'10/04'.
perform bdc_field using 'BDC_OKCODE'
'=PICK'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'10/04'.
perform bdc_field using 'BDC_OKCODE'
'=PICK'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'10/04'.
perform bdc_field using 'BDC_OKCODE'
'=OKAY'.
perform bdc_dynpro using 'SAPLSSEL' '1104'.
perform bdc_field using 'BDC_OKCODE'
'=CRET'.
perform bdc_field using 'BDC_CURSOR'
'%%DYN001-LOW'.
perform bdc_field using '%%DYN001-LOW'
'09/01/2012'.
perform bdc_field using '%%DYN002-LOW'
'C'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'04/03'.
perform bdc_field using 'BDC_OKCODE'
'=&ALL'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'04/03'.
perform bdc_field using 'BDC_OKCODE'
'=ABSA'.
perform bdc_dynpro using 'RVKRED01' '0201'.
perform bdc_field using 'BDC_OKCODE'
'=UEBE'.
perform bdc_field using 'BDC_CURSOR'
'TVAGT-ABGRU'.
perform bdc_field using 'TVAGT-ABGRU'
'20'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'04/03'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
perform bdc_transaction using 'VKM4'.
perform close_group.
Regards,
Carlos
‎2012 Sep 05 7:51 AM
Hi
using the table control you can implement for all the rows, you can find some threads of sample program in sdn.
‎2012 Sep 05 7:51 AM
Hi
using the table control you can implement for all the rows, you can find some threads of sample program in sdn.
‎2012 Sep 07 12:02 AM
I would like to select SD open documents with field VBUK-CMGST equal to A or D so I cand send field VBUK-VBELN to the perform part of BDC, one by one.
Since this is a big table anyone can give me an idea of the optimal way of doing this or there is a BAPI I can use for this?
Regards,
Carlos
‎2012 Sep 07 4:41 AM
Dear Carlos,
You can record multiple selections also, Since the mentioned field is a select option, you can record multiple values. Just follow the attached screen shots for more details:
The following is the recording for the mentioned field :
Hope it helps you, Thank you.
Regards,
Kartik
‎2012 Sep 07 5:22 PM
Thank you Kartik,
I can select them, but when I execute the BDC program, it exits after just processing the first row.
Seems that I have to execute the code with a Loop, but first I have to create an internal table that selects all the documents.
Regards,
Carlos
‎2021 Nov 13 4:55 PM