07-12-2014 7:03 AM
Hi Experts,
I am want to update item text in T-code FB02 or may be in FB09 so for this purpose I have recorded the transaction through SHDB but the screen where i need to change the item text changes every time in recording, I thought it may be happening due to change in Account type (BSEG-KOART) field but that was not the case. I have even tried FM FI_DOCUMENT_CHANGE to do the same but through this FM the item text is changed for few document only not for all.
{code}
CALL FUNCTION 'FI_DOCUMENT_CHANGE'
EXPORTING
i_buzei = indx " BUEZEI " Item number
i_bukrs = wa_fb02-bukrs
i_belnr = wa_fb02-belnr
i_gjahr = wa_fb02-gjahr
TABLES
t_accchg = t_accchg " Feild name to be changed, Old & New Value
EXCEPTIONS
no_reference = 1
no_document = 2
many_documents = 3
wrong_input = 4
overwrite_creditcard = 5
OTHERS = 6.
{code}
07-15-2014 7:13 AM
The actual dynpro depends on some fields (mwart, umskz, buzid, ktosl, etc.) and can be programmatically determined thru FM NEXT_DYNPRO_SEARCH
Alternative : use FM FI_ITEMS_MASS_CHANGE
Regards,
Raymond
07-12-2014 4:11 PM
07-13-2014 9:16 PM
Hi Ankit,
Did not worked, I have tried it before. FM executes for certain types of account types. I wonder what is the point behind doing so..
Regards,
Paavan
07-14-2014 3:39 AM
I think standard transaction also use this FM : FI_DOCUMENT_CHANGE'/ Create
Check the data which you are passing and which is there is standard is same or not ?
Thanks
Ankit Jain
07-14-2014 6:37 AM
Already checked everything. even debugged the FM. It is only working for account type D and K.
Thanks
Paavan
07-14-2014 7:52 PM
You're right, the screen number changes due to item KOART change: this FB02 number will change between KOART values K, D, M, S, A.
You have to create a CASE statement, setting a BDC for each type, like the following:
CASE lv_koart.
WHEN 'K'.
PERFORM fill_bdc USING: 'SAPMF05L' '0102' 'X',
'BDC_CURSOR' 'RF05L-BELNR' ' ',
'BDC_OKCODE' '/00' ' ',
'RF05L-BELNR' my_belnr ' ',
'RF05L-BUKRS' my_bukrs ' ',
'RF05L-GJAHR' my_gjahr ' ',
'RF05L-BUZEI' my_buzei ' '.
PERFORM fill_bdc USING: 'SAPMF05L' '0302' 'X',
'BDC_CURSOR' 'BSEG-FIELD' ' ',
'BDC_OKCODE' '=ZK' ' '.
PERFORM fill_bdc USING: 'SAPMF05L' '1302' 'X',
'BDC_CURSOR' 'BSEG-FIELD' ' ',
'BDC_OKCODE' '=ENTR' ' ',
'BSEG-XREF1' pf_xref1 ' '.
PERFORM fill_bdc USING: 'SAPMF05L' '0302' 'X',
'BDC_CURSOR' 'BSEG-FIELD' ' ',
'BDC_OKCODE' '=AE' ' '.
WHEN 'D'.
PERFORM fill_bdc USING: 'SAPMF05L' '0102' 'X',
'BDC_CURSOR' 'RF05L-BELNR' ' ',
'BDC_OKCODE' '/00' ' ',
'RF05L-BELNR' my_belnr ' ',
'RF05L-BUKRS' my_bukrs ' ',
'RF05L-GJAHR' my_gjahr ' ',
'RF05L-BUZEI' my_buzei ' '.
PERFORM fill_bdc USING: 'SAPMF05L' '0301' 'X',
'BDC_CURSOR' 'BSEG-FIELD' ' ',
'BDC_OKCODE' '=ZK' ' '.
PERFORM fill_bdc USING: 'SAPMF05L' '1301' 'X',
'BDC_CURSOR' 'BSEG-FIELD' ' ',
'BDC_OKCODE' '=ENTR' ' ',
'BSEG-XREF1' pf_xref1 ' '.
WHEN 'M'.
...
...
It gets even more complex if you're dealing with document parking tables items (VBSEGD, VBSEGK...)
07-15-2014 5:42 AM
Hi Lucas,
I have even tried that but at times for same Account Type (KOART) two different screens get called.
Regards,
Paavan.
07-15-2014 7:13 AM
The actual dynpro depends on some fields (mwart, umskz, buzid, ktosl, etc.) and can be programmatically determined thru FM NEXT_DYNPRO_SEARCH
Alternative : use FM FI_ITEMS_MASS_CHANGE
Regards,
Raymond
07-15-2014 8:39 AM
Hey Raymond,
Done through FM :- FI_ITEMS_MASS_CHANGE
Regards,
Paavan