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

BAPI_ACC_DOCUMENT_POST error

Former Member
0 Likes
2,727

Hi Forums!

I am progressing in my errors with this bapi but, I have run into this one:

612 No currency line exists for line item 0000000000

My Code, is populating the line items, I am not sure why this is occuring.


if not pcard_post_rec-zlsapac is initial.
    gt_doc_item-itemno_acc   = ls_posnr.
    gt_gl_item-gl_account = pcard_post_rec-zlsapac.
    gt_gl_item-comp_code = pcard_post_rec-zlsapco.
    gt_gl_item-pstng_date = pcard_post_rec-zlgpsdt.
    gt_gl_item-doc_type = doctype.
    gt_gl_item-alloc_nmbr = ls_assignment.

    IF pcard_post_rec-zlsapac < 500000.
      gt_gl_item-item_text    = ''.
    ELSE.
      gt_gl_item-item_text    = pcard_post_rec-zlguser.
    ENDIF.
    gt_gl_item-costcenter = pcard_post_rec-zlsapcc.
    gt_gl_item-orderid = LV_ORDNUM.

    APPEND gt_gl_item.

3 REPLIES 3
Read only

Former Member
0 Likes
998

HI

Maintain the field currency in the item structure bapiaccr09.

Regards,

Raghu

Read only

Former Member
0 Likes
998

issue in code:

Read only

Former Member
0 Likes
998

Hi,

You need to pass the currencyamount for every line item

Eg:-

For first line item..

itab_currencyamount-itemno_acc = '0000000001'.

itab_currencyamount-currency = 'USD'.

itab_currencyamount-amt_doccur = amount.

APPEND itab_currencyamount.

For second line item...

itab_currencyamount-itemno_acc = '0000000002'.

itab_currencyamount-currency = 'USD'.

itab_currencyamount-amt_doccur = amount.

APPEND itab_currencyamount.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

documentheader = documentheader

TABLES

accountgl = itab_accountgl

currencyamount = itab_currencyamount

return = itab_return.

Regards,

Satish