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

Doing batch input for VA01

Former Member
0 Likes
1,408

Hi,

I've use SHDB to see BDC instrution to do a batch input at VA01.

I'm already create ABAP program but batch input for materials doesn't work...

I've this to do items input

PERFORM bdc_dynpro USING 'SAPMV45A' '4900'.

IF lt_dados-material1 IS NOT INITIAL.

+linha = linha + 1.+

PERFORM bdc_field USING 'BDC_CURSOR'

'VBAP-MATNR'.

PERFORM bdc_field USING 'RV45A-MABNR(linha)'

lt_dados-material1.

PERFORM bdc_field USING 'RV45A-KWMENG(linha)'

lt_dados-qtde_mat1.

ELSEIF lt_dados-material2 IS NOT INITIAL.

+linha = linha + 1.+

PERFORM bdc_field USING 'BDC_CURSOR'

'VBAK-MATNR'.

PERFORM bdc_field USING 'RV45A-MABNR(linha)'

lt_dados-material2.

PERFORM bdc_field USING 'RV45A-KWMENG(linha)'

lt_dados-qtde_mat2.

ENDIF.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

All other fields are OK.

Can somebody help me ?

Thanks.

6 REPLIES 6
Read only

Former Member
0 Likes
1,109

What error are you getting?

Regards

Abhii

Read only

0 Likes
1,109

items doesn't appear...

Read only

brad_bohn
Active Contributor
0 Likes
1,109

The field name is wrong - check your BDC_CURSOR calls (one has VBAK_MATNR) and no step loop indicator - take them out and then pay attention to the error messages you're receiving. As always, go with the BAPI, not batch input...

Read only

Former Member
0 Likes
1,109

'VBAK-MATNR'.

Should be VBAP-MATNR.

Read only

Former Member
0 Likes
1,109

Hi,

Where you're using the code...

PERFORM bdc_field USING 'RV45A-MABNR(linha)'

Instead, you need to dynamically build the field name to represent the line number, ie.


data: L_FIELDNAME      TYPE FIELDNAME,
         LINHA_NUM(2)     TYPE N.
LINHA_NUM = LINHA.
CONCATENATE 'RV45A-MABNR(' LINHA_NUM ')' INTO L_FIELDNAME.

Then reference L_FIELDNAME as your variable screen field name.

You will need to repeat for each field in your screen...

Regards, Andy

Read only

Maciej_DomagaBa
Contributor
0 Likes
1,109

Instead of batch input for VA01 you can use fm BAPI_SALESORDER_CREATEFROMDAT2, that's much easier.

regards