‎2010 Sep 15 3:59 PM
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.
‎2010 Sep 15 4:13 PM
‎2010 Sep 15 4:26 PM
‎2010 Sep 15 4:14 PM
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...
‎2010 Sep 15 5:05 PM
‎2010 Sep 15 5:21 PM
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
‎2010 Sep 16 11:48 AM
Instead of batch input for VA01 you can use fm BAPI_SALESORDER_CREATEFROMDAT2, that's much easier.
regards