cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC_INPUT_COND_A Not Updating the Scales details

sagarsoora
Discoverer
0 Kudos

Hi

FM : IDOC_COND_A to create pricing conditions with scales. I am populating the scale ID and remaining details in respective IDOC segments but pricing conditions are getting created without scales.

Code:

wa_idoc_contrl-mestyp = lc_mestyp.

wa_idoc_contrl-doctyp = lc_doctyp.

wa_idoc_contrl-idoctp = lc_idoctp.

wa_idoc_contrl-test = abap_true.

APPEND wa_idoc_contrl TO it_idoc_contrl.

CLEAR: wa_idoc_contrl.

wa_e1komg-kvewe = i_kvewe.

wa_e1komg-kotabnr = i_kotabnr.

wa_e1komg-kappl = i_kappl.

wa_e1komg-kschl = i_kschl.

wa_e1komg-vakey = i_key_fields-field1_value.

CLEAR: lv_offset.

CLEAR wa_idoc_data.

wa_idoc_data-segnum = lc_1.

wa_idoc_data-segnam = lc_e1komg.

wa_idoc_data-hlevel = lc_1.

wa_idoc_data-sdata = wa_e1komg.

APPEND wa_idoc_data TO it_idoc_data.

wa_e1konh-datab = i_datab.

wa_e1konh-datbi = i_datbi.

CLEAR wa_idoc_data.

wa_idoc_data-segnum = lc_2.

wa_idoc_data-segnam = lc_e1konh.

wa_idoc_data-psgnum = lc_1.

wa_idoc_data-hlevel = lc_2.

wa_idoc_data-sdata = wa_e1konh.

APPEND wa_idoc_data TO it_idoc_data.

wa_e1konp-kschl = i_kschl.

wa_e1konp-krech = lv_krech.

IF i_konwa IS NOT INITIAL.

wa_e1konp-konwa = i_konwa.

ENDIF.

IF i_kbetr IS NOT INITIAL.

wa_e1konp-kbetr = i_kbetr.

ENDIF.

IF i_add_fields-mwsk1 IS NOT INITIAL.

wa_e1konp-mwsk1 = i_add_fields-mwsk1.

ENDIF.

IF i_add_fields-kpein IS NOT INITIAL.

wa_e1konp-kpein = i_add_fields-kpein.

ENDIF.

IF i_add_fields-kmein IS NOT INITIAL.

wa_e1konp-kmein = i_add_fields-kmein.

ENDIF.

wa_e1konp-stfkz = 'B'.

wa_e1konp-kzbzg = 'D'.

wa_e1konp-kstbm = '50.000'.

wa_e1konp-konms = 'KG'.

wa_e1konp-konws = 'EUR'.

wa_e1konp-kstbw = '22.000'.

wa_e1konp-klf_kal = '1'.

wa_e1konp-mdflg = '2'.

CLEAR wa_idoc_data.

wa_idoc_data-segnum = lc_3.

wa_idoc_data-segnam = lc_e1konp.

wa_idoc_data-psgnum = lc_2.

wa_idoc_data-hlevel = lc_3.

wa_idoc_data-sdata = wa_e1konp.

APPEND wa_idoc_data TO it_idoc_data.

*****Scales***************************************

wa_e1konm-kstbm = '50.000'.

wa_e1konm-kbetr = '12'.

CLEAR wa_idoc_data.

wa_idoc_data-segnum = lc_4.

wa_idoc_data-segnam = lc_e1konm.

wa_idoc_data-psgnum = lc_3.

wa_idoc_data-hlevel = lc_4.

wa_idoc_data-sdata = wa_e1konm.

APPEND wa_idoc_data TO it_idoc_data.

wa_e1konw-kstbw = '50.000'.

wa_e1konw-kbetr = '12'.

CLEAR wa_idoc_data.

wa_idoc_data-segnum = lc_5.

wa_idoc_data-segnam = lc_e1konw.

wa_idoc_data-psgnum = lc_3.

wa_idoc_data-hlevel = lc_4.

wa_idoc_data-sdata = wa_e1konw.

APPEND wa_idoc_data TO it_idoc_data.

wa_e1vfkonx-kopid = '1'.

wa_e1vfkonx-scaid = '572'."lc_scaid.

wa_e1vfkonx-scabas = 'D'.

CLEAR wa_idoc_data.

wa_idoc_data-segnum = lc_6.

wa_idoc_data-segnam = lc_e1vfkonx.

wa_idoc_data-psgnum = lc_3.

wa_idoc_data-hlevel = lc_4.

wa_idoc_data-sdata = wa_e1vfkonx.

APPEND wa_idoc_data TO it_idoc_data.

wa_e1vfscar-slfnr1 = '1'.

wa_e1vfscar-kbetr = '11'.

CLEAR wa_idoc_data.

wa_idoc_data-segnum = lc_7.

wa_idoc_data-segnam = lc_e1vfscar.

wa_idoc_data-psgnum = lc_3.

wa_idoc_data-hlevel = lc_4.

wa_idoc_data-sdata = wa_e1vfscar.

APPEND wa_idoc_data TO it_idoc_data.

wa_e1vfscah-scatyp = ls_e1vfscah-scatyp.

wa_e1vfscah-scabas = ls_e1vfscah-scabas.

wa_e1vfscah-scuof = ls_e1vfscah-scuof.

wa_e1vfscah-kpein = ls_e1vfscah-kpein.

wa_e1vfscah-kmein = ls_e1vfscah-kmein.

wa_e1vfscah-krech = ls_e1vfscah-krech.

wa_e1vfscah-lpein = ls_e1vfscah-lpein.

wa_e1vfscah-minflg = ls_e1vfscah-minflg.

wa_e1vfscah-tscalen = ls_e1vfscah-tscalen.

wa_e1vfscah-kappl = ls_e1vfscah-kappl.

CLEAR wa_idoc_data.

wa_idoc_data-segnum = lc_8.

wa_idoc_data-segnam = lc_e1vfscah.

wa_idoc_data-psgnum = lc_6.

wa_idoc_data-hlevel = lc_5.

wa_idoc_data-sdata = wa_e1vfscah.

APPEND wa_idoc_data TO it_idoc_data.

wa_e1vfscaix-slfnr = '1'.

wa_e1vfscaix-catyp = 'T'.

wa_e1vfscaix-scaval = '10'.

CLEAR wa_idoc_data.

wa_idoc_data-segnum = lc_9.

wa_idoc_data-segnam = lc_e1vfscaix.

wa_idoc_data-psgnum = lc_8.

wa_idoc_data-hlevel = lc_6.

wa_idoc_data-sdata = wa_e1vfscaix.

APPEND wa_idoc_data TO it_idoc_data.

**************************************************************

CALL FUNCTION 'IDOC_INPUT_COND_A'

EXPORTING

input_method = lc_2

mass_processing = lv_massprocess

TABLES

idoc_contrl = it_idoc_contrl

idoc_data = it_idoc_data

idoc_status = it_idoc_status

return_variables = it_return_var

serialization_info = it_serinfo

EXCEPTIONS

wrong_function_called = 1

OTHERS = 2.

Accepted Solutions (0)

Answers (0)