Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC Recording

Former Member
0 Likes
1,624

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    

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,356

Hi

using the table control you can implement for all the rows, you can find some threads of sample program in sdn.

5 REPLIES 5
Read only

Former Member
0 Likes
1,357

Hi

using the table control you can implement for all the rows, you can find some threads of sample program in sdn.

Read only

Former Member
0 Likes
1,356

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

Read only

0 Likes
1,356

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

Read only

0 Likes
1,356

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

Read only

achal_mukaty
Explorer
0 Likes
1,356

Provide more information.