on 03-04-2008 3:26 PM
Hi all,
please help me.
When I use BADI BBP_CTR the method MODIFY_DATA_CTR:
METHOD if_ex_bbp_ctr~modify_data_ctr.
field-symbols:
<ls_be_it> type BAPICONDIT.
loop at CT_CND_IT assigning <ls_be_it>.
if <ls_be_it>-condcurr eq 'RUB'.
<ls_be_it>-condcurr = 'RUR'.
modify CT_CND_IT from <ls_be_it>.
endif.
endloop.
In the bd87 I have IDOC, but if I use the method MODIFY_IDOC_DATA_CTR IDOC is not created.
The example MODIFY_IDOC_DATA_CTR:
method IF_EX_BBP_CTR~MODIFY_IDOC_DATA_CTR.
DATA: ls_e1edk18 TYPE e1edk18,
ls_blaord TYPE EDIDD.
LOOP AT ct_blaord into ls_blaord where segnam = 'E1EDK18'.
ls_e1edk18 = ls_blaord-sdata.
if ls_e1edk18-qualf = '001'.
ls_e1edk18-tage = is_header-zzihrez.
endif.
move ls_e1edk18 to ls_blaord-sdata.
modify ct_blaord from ls_blaord.
endloop.
How to use method MODIFY_IDOC_DATA_CTR in order to created IDOC.
Best regards,
Guzal.
Hi,
The contracts are posted into R/3 system using the IDocs. The method MODIFY_IDOC_DATA_CTR infact provide us a flexibility to modify the contents that will be used to create the IDoc and does not play the direct role in creation the IDocs.
Please find a sample code which works well:
METHOD if_ex_bbp_ctr~modify_idoc_data_ctr.
* Declaration for Local Constants
CONSTANTS: lc_e1edp01(7) TYPE c VALUE 'E1EDP01',
lc_e1edk14(7) TYPE c VALUE 'E1EDK14',
lc_orgid(3) TYPE c VALUE '011'.
* Declaration for Local Work Areas
DATA: ls_t001k TYPE t001k,
ls_edidd TYPE edidd,
ls_e1edp01 TYPE e1edp01.
* Declaration for Local Variables
DATA: lv_bukrs TYPE bukrs.
* Declaration for Field Symbols
FIELD-SYMBOLS : <fs_edidd> TYPE edidd.
* Initialize the Local VAriables
CLEAR: ls_t001k, ls_edidd, ls_e1edp01, lv_bukrs.
* Read the required IDoc entry
READ TABLE ct_blaord INTO ls_edidd
WITH KEY segnam = lc_e1edp01.
IF sy-subrc EQ 0.
* Extract the SDATA
ls_e1edp01 = ls_edidd-sdata.
* Select the appropiate Company Code
SELECT SINGLE bukrs FROM t001k
INTO lv_bukrs
WHERE bwkey = ls_e1edp01-werks.
IF NOT lv_bukrs IS INITIAL.
* Finally update the Company Code selected in the IDoc
LOOP AT ct_blaord ASSIGNING <fs_edidd>
WHERE segnam = lc_e1edk14.
IF <fs_edidd>-sdata(3) = lc_orgid.
<fs_edidd>-sdata+3(4) = lv_bukrs.
ENDIF.
ENDLOOP. "LOOP AT ct_blaord
ENDIF. "IF NOT lv_bukrs
ENDIF. "IF sy-subrc EQ 0.
ENDMETHOD.
Besides if the IDocs are getting generated, then I presume the BADI implementation is not correct. The errors can be seen in Application Monitor (SRM). Hope this helps.
Regards
Kathirvel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Kathirvel !
Thank you very much,
your answer help me.
Best regards,
Guzal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.