Application Development 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: 

BAPI_ACC_DOCUMENT_POST co-pa- enter quantity data

former_member637921
Participant
0 Kudos
448

Hello,

I would like to insert quntity data in the document for the CO-PA field ABSMG in the CE1**** table.

In the code i relate it to fieldname  'ARTNR' (i think this might be the problem).

When i use only the criteria table, it works fine, but when i add the valuefield table i recieve an error that  'ARTNR' is not known.

When we do it manualy (not by code) it works OK

DATA: ls_criteria LIKE LINE OF ct_criteria,
           ls_valuefield
LIKE LINE OF ct_valuefield.

    ls_criteria
-itemno_acc = i_tabix.
    ls_criteria
-fieldname = 'ARTNR'.
    ls_criteria
-character = is_bapi_line-kupa.
   
APPEND ls_criteria TO ct_criteria.
    ls_criteria
-itemno_acc = i_tabix.
    ls_criteria
-fieldname = 'WERKS'.
    ls_criteria
-character = is_bapi_line-comp_code.
   
APPEND ls_criteria TO ct_criteria.

    ls_valuefield
-itemno_acc = i_tabix.
    ls_valuefield
-fieldname = 'ARTNR'.
    ls_valuefield-base_uom = 'EA'.
    ls_valuefield
-qua_valcom = is_bapi_line-quantity.
   
APPEND ls_valuefield TO ct_valuefield.

Any ideas?

Thanks,

Moshe

1 ACCEPTED SOLUTION

former_member188724
Contributor
0 Kudos
135

Hi Moshe,

Pls try giving the ref_field in the fieldname from CE1* table by referring the ref field in the currency/Quantity tab for ABSMG field.

Hope it helps.

Regards,

K.S

7 REPLIES 7

former_member188724
Contributor
0 Kudos
136

Hi Moshe,

Pls try giving the ref_field in the fieldname from CE1* table by referring the ref field in the currency/Quantity tab for ABSMG field.

Hope it helps.

Regards,

K.S

0 Kudos
135

Thanks KS

the code is:

    ls_valuefield-fieldname = 'ABSMG'.
    ls_valuefield-base_uom = 'EA'.
    ls_valuefield-qua_valcom = is_bapi_line-quantity.
    APPEND ls_valuefield TO ct_valuefield.

Now i'm trying to update also the amount in field VV500 and i'm trying to code the same way:

ls_valuefield-itemno_acc = i_tabix.
ls_valuefield
-fieldname = 'ABSMG'.
ls_valuefield
-base_uom = 'EA'.
ls_valuefield
-qua_valcom = is_bapi_line-quantity.
APPEND ls_valuefield TO ct_valuefield.

ls_valuefield
-itemno_acc = i_tabix.
ls_valuefield
-fieldname = 'VV500'.
ls_valuefield
-curr_type = '00'.
ls_valuefield
-currency = 'ILS'.
ls_valuefield
-amt_valcom = is_bapi_line-amt_doccur.
APPEND ls_valuefield TO ct_valuefield.

But i get error of 2 value fields. Any ideas?



0 Kudos
135

Hi,

When you use UOM as EA pls check whether it is maintained as EA for the language that you execute.

IN DE it will be ST and not EA.

Please share you Piece of code of your data declarations.

Regards,

K.S

0 Kudos
135

Hi,

I think that the problem is no with UOM because if i append onl the ABSMG to valuefield it works OK.

However when i try to update the valuefield amount of CO-PA in VV500 i get error of 2 valuefields in 1 line is not possible.

the full code is:

DATA: ls_criteria LIKE LINE OF ct_criteria,
           ls_valuefield
LIKE LINE OF ct_valuefield.

    ls_criteria-itemno_acc = i_tabix.
    ls_criteria
-fieldname = 'ARTNR'.
    ls_criteria
-character = is_bapi_line-kupa.
   
APPEND ls_criteria TO ct_criteria.

    ls_criteria
-itemno_acc = i_tabix.
    ls_criteria
-fieldname = 'WERKS'.
    ls_criteria
-character = is_bapi_line-comp_code.
   
APPEND ls_criteria TO ct_criteria.

    ls_valuefield-itemno_acc = i_tabix.
    ls_valuefield
-fieldname = 'ABSMG'.
    ls_valuefield
-base_uom = 'EA'.
    ls_valuefield
-qua_valcom = is_bapi_line-quantity.
   
APPEND ls_valuefield TO ct_valuefield.

    ls_valuefield
-itemno_acc = i_tabix.
    ls_valuefield
-fieldname = 'VV500'.
    ls_valuefield
-curr_type = '00'.
    ls_valuefield
-currency = 'ILS'.
    ls_valuefield
-amt_valcom = is_bapi_line-amt_doccur.
   
APPEND ls_valuefield TO ct_valuefield.

0 Kudos
135

Hi,

Pls clear ls_valuefield as the valuefield filled for ABSMG is not yet cleared and it will have say BASE_UOM as 'EA'.

Try Clearing ls_valuefield and check whether you get it resolved.

Regards,

K.S

0 Kudos
135

didn't think about it. Good idea. I'll try and update you

0 Kudos
135

It worked!

Thanks K.S