Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

f-43

Hi gurus,

I am working on an interface where I need to post an accounting document using 'f-43' and for this I have written the following code, the problem that I am facing right now is ...the posting keys that I am using is 31 and 41, but somehow when I run my program the document tht is being posted after that program shows me keys 40 and 50 instead of 31 and 40. So can you please guide me through.

move:

'RFBU' to documentheader-bus_act,

it_input-doc_date2 to documentheader-doc_date,

it_input_posdate2 to documentheader-pstng_date,

it_input-doc_type to documentheader-doc_type,

it_input-bukrs to documentheader-comp_code,

it_input-pos_per to documentheader-fis_period,

it_inputfis_year to documentheader-fisc_year,

it_input-reference to documentheader-ref_doc_no,

it_input-h_text to documentheader-header_txt,

syst-uname to documentheader-username.

ENDFORM. " add_header

&----


*& Form add_entry

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM add_entry .

if it_input_file-pos_key eq 31.

move:

v_count to glaccount-ITEMNO_ACC,

it_input-glaccount to glaccount-gl_account,

it_input-kostl to glaccount-COSTCENTER,

it_input-prctr to glaccount-PROFIT_CTR,

it_input-bus_area to glaccount-bus_area,

it_input-item_text to glaccount-ITEM_TEXT,

it_input-assignment to glaccount-ALLOC_NMBR.

append glaccount.

move:

v_count to currencyamount-ITEMNO_ACC,

it_input-currency to currencyamount-CURRENCY,

it_input-amount to currencyamount-AMT_DOCCUR .

append currencyamount.

clear: glaccount, currencyamount.

else.

move: v_count to glaccount-ITEMNO_ACC,

it_input-glaccount to glaccount-gl_account,

it_input-kostl to glaccount-COSTCENTER,

it_input-prctr to glaccount-PROFIT_CTR,

it_input-bus_area to glaccount-bus_area,

it_input-item_text to glaccount-ITEM_TEXT,

it_input-assignment to glaccount-ALLOC_NMBR.

append glaccount.

move:

v_count to currencyamount-ITEMNO_ACC,

it_input-currency to currencyamount-CURRENCY.

currencyamount-AMT_DOCCUR = it_input-amount * -1.

append currencyamount.

clear: glaccount, currencyamount.

endif.

my input file looks like this:

the heading are in this sequence: pos_date(10),

doc_type,

pos_per,

bukrs,

h_text,

currency,

doc_date,

reference,

pos_key,

lifnr,

glaccount,

amount,

pay_term,

pay_method,

pay_block,

pay_suppmethod,

assignment,

item_text,

bus_area,

kostl,

prctr,

seq_num,

doc_date2,

pos_date2,

fis_year,

10/12/2007 KR 1000 USD 10/12/2007 1 31 100000 0000100000 1000 C AG2008

USD 1 41 100000 0000636100 1000 0000200000

Thanks

Rajeev

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question