Skip to Content
Former Member
Aug 28, 2009 at 10:17 AM

BSEG table


I am populating BAPI i m getting values for posting postin key is not there in BAPI..i m writing below code and finding out whether it is credit/debit...

The document is getting posted correctly...BUT my problem is every time...when i goto BSEG table and see the posting key(BSCHL) is showing something else...if i pass 34 for 1st line item i getting 31...PLS help


CLEAR : lv_wrbtr1,lv_wrbtr, lv_shkzg.

SELECT SINGLE shkzg FROM bseg INTO lv_shkzg

WHERE bukrs = wa_finput-bukrs

AND bschl = wa_finput-newbs.

*--(S = debit, H = credit)

MOVE wa_finput-wrbtr TO lv_wrbtr1.

IF lv_shkzg = 'S'.

MOVE lv_wrbtr1 TO lv_wrbtr.

ELSEIF lv_shkzg = 'H'.

CONCATENATE '-' lv_wrbtr1 INTO lv_wrbtr.