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: 

Screen number Change in FB02 & FB09 BDC Recording

former_member184504
Participant
0 Kudos

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}

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

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

8 REPLIES 8

Former Member
0 Kudos

Please commit and wait after execution of the FM

Thanks

Ankit

0 Kudos

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

0 Kudos

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

0 Kudos

Already checked everything. even debugged the FM. It is only working for account type D and K.

Thanks

Paavan

former_member546068
Discoverer
0 Kudos

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...)

0 Kudos

Hi Lucas,

I have even tried that but at times for same Account Type (KOART) two different screens get called.

Regards,

Paavan.

raymond_giuseppi
Active Contributor
0 Kudos

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

0 Kudos

Hey Raymond,

Done through  FM  :- FI_ITEMS_MASS_CHANGE

Regards,

Paavan