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

Batch input in EXIT_SAPLVEDA_002

Former Member
0 Likes
2,789

Hi together,

I have a problem with poulation the field VBAP-GRKOR in the user-exit EXIT_SAPLVEDA_002.

I found a similar topic here:

Please see my code below:

      IF dlast_dynpro = '4001'.

        LOOP AT dxvbap.
          wa_dxvbap = dxvbap.

* Ok code for Screen.
          dxbdcdata-fnam = 'BDC_OKCODE'.
          dxbdcdata-fval = '=T\06'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

          dxbdcdata-fnam = 'BDC_OKCODE'.
          dxbdcdata-fval = '/00'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

          dxbdcdata-program = 'SAPMV45A'.
          dxbdcdata-dynpro   = '4001'.
          dxbdcdata-dynbegin = 'X'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

* Populate data
          dxbdcdata-fnam = 'VBAP-GRKOR'.
          dxbdcdata-fval = wa_dxvbap-grkor.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

The subscreen is screen 4921 - but I think in batch input I haven't to call the subscreen.

The BDC_OKDATA I got from a batch input record which I done.

Here is the record:

SAPMV45A 4001 X                                                                                                                                                                                                                                                                         

                                                BDC_OKCODE /00

                                                BDC_SUBSCR SAPMV45A                                4021SUBSCREEN_HEADER

                                                VBKD-BSTKD test

                                                BDC_SUBSCR SAPMV45A                                4701PART-SUB

                                                KUAGV-KUNNR 10041911

                                                KUWEV-KUNNR 10041911

                                                BDC_SUBSCR SAPMV45A                                4403SUBSCREEN_BODY

                                                BDC_SUBSCR SAPMV45A                                4921SUBSCREEN_TC

                                                BDC_CURSOR VBAP-GRKOR(01)

                                                VBAP-GRKOR(01) 999

                                                BDC_SUBSCR SAPMV45A                                4050SUBSCREEN_BUTTONS

I tried several ways. Some error messages I got:

No batch input data for screen SAPMV45A 4001

Field VBAP-GRKOR. does not exist in the screen SAPMV45A 4001

Has anyone a hint for me?

Kind regards

Thomas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,158

Hi,

please create a recording with the transaction recoder (tcode SHDB) and compare the generated sample program with your program code.

Regards,

Klaus

Hi together,

I have a problem with poulation the field VBAP-GRKOR in the user-exit EXIT_SAPLVEDA_002.

I found a similar topic here:

Please see my code below:

      IF dlast_dynpro = '4001'.

        LOOP AT dxvbap.
          wa_dxvbap = dxvbap.

* Ok code for Screen.
          dxbdcdata-fnam = 'BDC_OKCODE'.
          dxbdcdata-fval = '=T\06'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

          dxbdcdata-fnam = 'BDC_OKCODE'.
          dxbdcdata-fval = '/00'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

          dxbdcdata-program = 'SAPMV45A'.
          dxbdcdata-dynpro   = '4001'.
          dxbdcdata-dynbegin = 'X'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

* Populate data
          dxbdcdata-fnam = 'VBAP-GRKOR'.
          dxbdcdata-fval = wa_dxvbap-grkor.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

The subscreen is screen 4921 - but I think in batch input I haven't to call the subscreen.

The BDC_OKDATA I got from a batch input record which I done.

Here is the record:

SAPMV45A 4001 X                                                                                                                                                                                                                                                                         

                                                BDC_OKCODE /00

                                                BDC_SUBSCR SAPMV45A                                4021SUBSCREEN_HEADER

                                                VBKD-BSTKD test

                                                BDC_SUBSCR SAPMV45A                                4701PART-SUB

                                                KUAGV-KUNNR 10041911

                                                KUWEV-KUNNR 10041911

                                                BDC_SUBSCR SAPMV45A                                4403SUBSCREEN_BODY

                                                BDC_SUBSCR SAPMV45A                                4921SUBSCREEN_TC

                                                BDC_CURSOR VBAP-GRKOR(01)

                                                VBAP-GRKOR(01) 999

                                                BDC_SUBSCR SAPMV45A                                4050SUBSCREEN_BUTTONS

I tried several ways. Some error messages I got:

No batch input data for screen SAPMV45A 4001

Field VBAP-GRKOR. does not exist in the screen SAPMV45A 4001

Has anyone a hint for me?

Kind regards

Thomas

7 REPLIES 7
Read only

Lakshmipathi
Active Contributor
0 Likes
2,158

Not a functional query.  Hence, moved from SAP ERP SD Sales to ABAP Development

G. Lakshmipathi

Read only

Former Member
0 Likes
2,159

Hi,

please create a recording with the transaction recoder (tcode SHDB) and compare the generated sample program with your program code.

Regards,

Klaus

Read only

0 Likes
2,158

Hi,

thank you for your answer. I have done so - this is the resutlt:

perform bdc_dynpro      using 'SAPMV45A' '4001'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.

perform bdc_field       using 'VBKD-BSTKD'
                              'test'.

perform bdc_field       using 'KUAGV-KUNNR'
                              '10041911'.

perform bdc_field       using 'KUWEV-KUNNR'
                              '10041911'.

perform bdc_field       using 'BDC_CURSOR'
                              'VBAP-GRKOR(01)'.

perform bdc_field       using 'VBAP-GRKOR(01)'
                              '999'.

and I got the same error as before with the coding below. I've tried it also without (1).

        LOOP AT dxvbap.
          wa_dxvbap = dxvbap.

* data screen
          dxbdcdata-program = 'SAPMV45A'.
          dxbdcdata-dynpro   = '4001'.
*         dxbdcdata-dynbegin = 'X'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

          dxbdcdata-fnam = 'BDC_OKCODE'.
          dxbdcdata-fval = '/00'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

          dxbdcdata-fnam = 'BDC_CURSOR(01)'.
          dxbdcdata-fval = 'VBAP-GRKOR'.
          APPEND dxbdcdata.

          CLEAR: dxbdcdata.

          dxbdcdata-fnam = 'VBAP-GRKOR(01)'.
          dxbdcdata-fval = wa_dxvbap-grkor.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

        ENDLOOP.

Read only

0 Likes
2,158

Hi,

I think there is something missing in the generated code you've posted.

Every tcode for SAPMV45A in table TSTC start with one of the following screen.:

  • 0101
  • 0102
  • 0105
  • 0125
  • 0126
  • 0130

Which tcode do you want to call? VA02 for example starts with dynpro 0102.

It's very important to call the dynpros in the right order and fill the matching BDC_OKCODE.

In your 1st post you're sending two BDC_OKCODE entries 'T\06' and '/00' immediately after the other. This will not work, the second OKCODE '/00' will overwrite the first one 'T\06' in this case.

Regards,

Klaus

Read only

0 Likes
2,158

Hi,

thanks a lot for your reply.

I call transaction VA01 or rather the user-exit is called when the Idoc create a sales order.

I made a record in SHDB and created a report from this record.

The important step is where VBAP-GRKOR is filled with the value '999'.

Referencing to the topic (see my question) where one found the solution for head and position, I think it's not necessary to call in this exit the dynpro 0101. So I tried to start with dlast_dynpro 4001, 4003 and 5003 - without success.

I've tried it with VBAP-GRKOR(01) and VBAP-GRKOR no matter - I got allway the error message, that the field is unkown in the dynpro...

Any other ideas?

Kind regards Thomas

      IF dlast_dynpro = '4001'.

        LOOP AT dxvbap.
          CHECK l_vbap_added IS INITIAL.
          wa_dxvbap = dxvbap.

          dxbdcdata-fnam = 'BDC_OKCODE'.
          dxbdcdata-fval = '/00'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

* data screen
          dxbdcdata-program = 'SAPMV45A'.
          dxbdcdata-dynpro   = '4001'.
          dxbdcdata-dynbegin = 'X'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.


* Populate data
          dxbdcdata-fnam = 'VBAP-GRKOR'.
          dxbdcdata-fval = wa_dxvbap-grkor.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

          dxbdcdata-fnam = 'BDC_OKCODE'.
          dxbdcdata-fval = '/EBACK'.
          APPEND dxbdcdata.
          CLEAR: dxbdcdata.

          l_vbap_added  = 'X'.


        ENDLOOP.

Read only

0 Likes
2,158

Hi Thomas,

your table dxbdcdata contains data before reaching the loop, right?

Then you set okcode '/00' for the last screen 4001.

But:

For each screen

dxbdcdata-program = 'SAPMV45A'.

dxbdcdata-dynpro   = '4001'.

only 1 okcode can be processed.

You set okcode to  '/EBACK'.

If LOOP has only one line to process this might be right. But if LOOP has further lines you'll overwrite okcode '/EBACK' with okcode '/00' for your screen 4001 at the beginning of the next LOOP run. If you append a second okcode, only the second okcode will be processed. If you want to avoid that, you have to copy the code for * data screen before the end of the loop. Stop in debugger and make sure, you have pairs of screens and okcodes. If two okcodes are following without a new screen. there will be an error.

Regards,

Klaus

Read only

0 Likes
2,158

Hi Klaus,

thank you for your help.

I gave up this way. I think it's to difficult into this dynpro in batch input.

I understand now this exit a bit better. I chose the way via a z-field on additional data B screen and as it described in the other post.

Regards

Thomas