0% found this document useful (0 votes)
328 views68 pages

Zbapi Mat Create W

This report creates material master records using BAPIs. It declares variables and data types for calling various BAPIs to create material master records, maintain material master extensions, create object classification records, and log data. Tables are declared to collect return data from the BAPIs as well as error and success messages.

Uploaded by

waseem27_1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
328 views68 pages

Zbapi Mat Create W

This report creates material master records using BAPIs. It declares variables and data types for calling various BAPIs to create material master records, maintain material master extensions, create object classification records, and log data. Tables are declared to collect return data from the BAPIs as well as error and success messages.

Uploaded by

waseem27_1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 68

*&---------------------------------------------------------------------*

*& Report ZBAPI_MAT_CREATE_W


*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zbapi_mat_create_w.
TABLES: t100.
DATA : v_steuc TYPE marc-steuc.

TYPES: BEGIN OF i_common,


matnr TYPE matnr,
mbrsh TYPE mbrsh,
mtart TYPE mtart,
werks_d TYPE werks_d,
lgort_d TYPE lgort_d,
vkorg TYPE vkorg,
vtweg TYPE vtweg,
maktx TYPE maktx,
meins TYPE meins,
matkl TYPE matkl,
bismt TYPE bismt,
extwg TYPE extwg,
spart TYPE spart,
labor TYPE labor,
prodh_d TYPE prodh_d,
mstae TYPE mstae,
mtpos TYPE mtpos,
brgew TYPE brgew,
gewei TYPE gewei,
ntgew TYPE ntgew,
volum TYPE volum,
voleh TYPE voleh,
ferth TYPE ferth,
wrkst TYPE wrkst,
sktof TYPE sktof,
taxkm1 TYPE taxkm,
taxkm2 TYPE taxkm,
taxkm3 TYPE taxkm,
taxkm4 TYPE taxkm,
taxkm5 TYPE taxkm,
taxkm6 TYPE taxkm,
taxkm7 TYPE taxkm,
taxkm8 TYPE taxkm,
stgma TYPE stgma,
kondm TYPE kondm,
ktgrm TYPE ktgrm,
mtpos_mara TYPE mtpos_mara,
prodh_d2 TYPE prodh_d,
provg TYPE provg,
mvgr1 TYPE mvgr1,
mvgr2 TYPE mvgr2,
mvgr3 TYPE mvgr3,
mtvfp TYPE mtvfp,
uchkz TYPE uchkz,
tragr TYPE tragr,
ladgr TYPE ladgr,
prctr TYPE prctr,
ekgrp TYPE ekgrp,
kautb TYPE kautb,
ekwsl TYPE ekwsl,
webaz TYPE webaz,
bapiupdate TYPE bapiupdate,
usequ TYPE usequ,
kordb TYPE kordb,
maabc TYPE maabc,
mmsta TYPE mmsta,
dismm TYPE dismm,
minbe TYPE minbe,
fxhor TYPE fxhor,
dispo TYPE dispo,
bstmi TYPE bstmi,
bstma TYPE bstma,
disls TYPE disls, "lot size
bstfe TYPE bstfe,
ausss TYPE ausss,
takzt TYPE takzt,
bstrf TYPE bstrf,
beskz TYPE beskz,
kzech TYPE kzech,
sobsl TYPE sobsl,
lgort_d1 TYPE lgort_d,
lgfsb TYPE lgfsb,
*j_1bownpro TYPE j_1bownpro,
dzeit TYPE dzeit,
plifz TYPE plifz,
fhori TYPE fhori,
eisbe TYPE eisbe,
rwpro TYPE rwpro,
perkz TYPE perkz,
strgr TYPE strgr,
*modaw TYPE modaw,
altsl TYPE altsl,
sbdkz TYPE sbdkz,
lminb TYPE lminb,
fevor TYPE fevor,
co_prodprf TYPE co_prodprf,
umren TYPE umren,
lzeih TYPE lzeih,
umrez TYPE umrez,
meins2 TYPE meins,
umren3 TYPE umren,
lzeih3 TYPE lzeih,
umrez3 TYPE umrez,
meins3 TYPE meins,
lgpbe TYPE lgpbe,
abcin TYPE abcin,
maxlz TYPE maxlz,
mhdrz TYPE mhdrz,
mhdhb TYPE mhdhb,
dattp TYPE dattp,
lzeih2 TYPE lzeih,
qmatauth TYPE qmatauth,
kzdkz TYPE kzdkz,
prfrq TYPE prfrq,
qmpur TYPE qmpur,
qsspur TYPE qsspur,
qzgtyp TYPE qzgtyp,
bwtty_d TYPE bwtty_d,
bklas TYPE bklas,
vprsv TYPE vprsv,
peinh TYPE peinh,
verpr_bapi TYPE verpr_bapi,
xlifo TYPE xlifo,
ck_no_costing TYPE ck_no_costing,
ck_ekalrel TYPE ck_ekalrel,
j_1bmatorg TYPE j_1bmatorg,
hkmat TYPE hkmat,
ck_kosgr TYPE ck_kosgr,
awsls TYPE awsls,
ck_sobsl TYPE ck_sobsl,
ck_losgr TYPE ck_losgr,
dzplpr_bapi TYPE dzplpr_bapi,
dzpld1 TYPE dzpld1,
vrkme TYPE vrkme,
j_1ichid TYPE j_1ichid,
klassenart TYPE klassenart,
steuc TYPE steuc,
j_1icapind TYPE j_1icapind,
qmpdau TYPE qmpdau,
qpart1 TYPE qpart,
qpart2 TYPE qpart,
qpart3 TYPE qpart,
qpart4 TYPE qpart,
qpart5 TYPE qpart,
maktx_t TYPE maktx,
sale_text(100),
sale_text2(100),
whse_no TYPE bapi_mlgn-whse_no,
withdrawal TYPE bapi_mlgn-withdrawal,
placement TYPE bapi_mlgn-placement,
whse_no1 TYPE bapi_mlgn-whse_no,
withdrawal1 TYPE bapi_mlgn-withdrawal,
placement1 TYPE bapi_mlgn-placement,
ean11 TYPE smeinh-ean11,
meinh TYPE smeinh-meinh,
numtp TYPE smeinh-numtp,
ean11_1 TYPE smeinh-ean11,
meinh_1 TYPE smeinh-meinh,
numtp_1 TYPE smeinh-numtp,
ean11_2 TYPE smeinh-ean11,
meinh_2 TYPE smeinh-meinh,
numtp_2 TYPE smeinh-numtp,
dwerk TYPE mvke-dwerk,
******
LENGTH1 type BAPI_MARM-LENGTH,
WIDTH1 type BAPI_MARM-WIDTH,
HEIGHT1 type BAPI_MARM-HEIGHT,
UNIT_DIM1 type bapi_marm-UNIT_DIM,
LENGTH2 type BAPI_MARM-LENGTH,
WIDTH2 type BAPI_MARM-WIDTH,
HEIGHT2 type BAPI_MARM-HEIGHT,
UNIT_DIM2 type bapi_marm-UNIT_DIM,
LENGTH type BAPI_MARM-LENGTH,
WIDTH type BAPI_MARM-WIDTH,
HEIGHT type BAPI_MARM-HEIGHT,
UNIT_DIM type bapi_marm-UNIT_DIM, " Unit of Dimension for Length/Width/Height
umren4 TYPE umren, " Denominator
lzeih4 TYPE lzeih, " Alternate Unit
umrez4 TYPE umrez, " Numerator
*meins4 TYPE meins, " Unit
*GROSS_WT type bapi_marm-GROSS_WT, " Gross weight
*UNIT_OF_WT type bapi_marm-UNIT_OF_WT, "Unit referring to the gross weight
ean11_3 TYPE smeinh-ean11,
meinh_3 TYPE smeinh-meinh,
numtp_3 TYPE smeinh-numtp,
LENGTH4 type BAPI_MARM-LENGTH,
WIDTH4 type BAPI_MARM-WIDTH,
HEIGHT4 type BAPI_MARM-HEIGHT,
UNIT_DIM4 type bapi_marm-UNIT_DIM,
gross_wt1 type brgew,
gross_wt2 type brgew,
gross_wt3 type brgew,
FORMT type BAPI_MARA-pageformat,
STGESECTOR TYPE BAPI_MLGN-STGESECTOR,
lgort_d2 type lgort_d,
*PO_UNIT type BAPI_MARA-PO_UNIT,
END OF i_common.
DATA : i TYPE sy-tabix VALUE 1.
DATA: ean11_t TYPE smeinh-ean11,
meinh_t TYPE smeinh-meinh,
numtp_t TYPE smeinh-numtp.
DATA: it_common TYPE STANDARD TABLE OF i_common,
wa_common TYPE i_common.
DATA: wa_headdata TYPE bapimathead,
wa_clientdata TYPE bapi_mara,
wa_clientdatax TYPE bapi_marax,
wa_plantdata TYPE bapi_marc,
wa_plantdatax TYPE bapi_marcx,
wa_forecastparameters TYPE bapi_mpop,
wa_forecastparametersx TYPE bapi_mpopx,
wa_planningdata TYPE bapi_mpgd,
wa_planningdatax TYPE bapi_mpgdx,
wa_storagelocationdata TYPE bapi_mard,
wa_storagelocationdatax TYPE bapi_mardx,
wa_valuationdata TYPE bapi_mbew,
wa_valuationdatax TYPE bapi_mbewx,
wa_warehousenumberdata TYPE bapi_mlgn,
wa_warehousenumberdatax TYPE bapi_mlgnx,
wa_salesdata TYPE bapi_mvke,
wa_salesdatax TYPE bapi_mvkex,
wa_storagetypedata TYPE bapi_mlgt,
wa_storagetypedatax TYPE bapi_mlgtx,
wa_flag_online TYPE bapie1global_data-testrun,
wa_flag_cad_call TYPE bapie1global_data-testrun,
wa_no_dequeue TYPE bapie1global_data-testrun,
wa_no_rollback_work TYPE bapie1global_data-testrun.
*DATA: it_return LIKE TABLE OF BAPIRET2 WITH HEADER LINE,
DATA: wa_return TYPE bapiret2,
it_return TYPE TABLE OF bapiret2,
it_materialdescription TYPE TABLE OF bapi_makt,
wa_materialdescription TYPE bapi_makt,
it_unitsofmeasure TYPE TABLE OF bapi_marm,
wa_unitsofmeasure TYPE bapi_marm,
it_unitsofmeasurex TYPE TABLE OF bapi_marmx,
wa_unitsofmeasurex TYPE bapi_marmx,
it_internationalartnos TYPE TABLE OF bapi_mean,
wa_internationalartnos TYPE bapi_mean,
it_materiallongtext TYPE TABLE OF bapi_mltx,
wa_materiallongtext TYPE bapi_mltx,
it_taxclassifications TYPE TABLE OF bapi_mlan,
wa_taxclassifications TYPE bapi_mlan,
it_returnmessages TYPE TABLE OF bapi_matreturn2,
wa_returnmessages TYPE bapi_matreturn2,
it_prtdata TYPE TABLE OF bapi_mfhm,
wa_prtdata TYPE bapi_mfhm,
it_prtdatax TYPE TABLE OF bapi_mfhmx,
wa_prtdatax TYPE bapi_mfhmx,
it_extensionin TYPE TABLE OF bapiparex,
wa_extensionin TYPE bapiparex,
it_extensioninx TYPE TABLE OF bapiparexx,
wa_extensioninx TYPE bapiparexx,
it_nfmchargeweights TYPE TABLE OF /nfm/bapitvgw,
wa_nfmchargeweights TYPE /nfm/bapitvgw,
it_nfmchargeweightsx TYPE TABLE OF /nfm/bapitvgwx,
wa_nfmchargeweightsx TYPE /nfm/bapitvgwx,
it_nfmstructuralweights TYPE TABLE OF /nfm/bapitkgw,
wa_nfmstructuralweights TYPE /nfm/bapitkgw,
it_nfmstructuralweightsx TYPE TABLE OF /nfm/bapitkgwx,
wa_nfmstructuralweightsx TYPE /nfm/bapitkgwx.
"************* BAPI_MATINSPCTRL_SAVEREPLICA DECLARATIONS **********************
TYPES: BEGIN OF ty_error,
type TYPE bapiret2-type,
message TYPE bapiret2-message,
END OF ty_error.
TYPES: BEGIN OF ty_success,
type TYPE bapiret2-type,
message(1024),
* message TYPE bapiret2-message,
END OF ty_success.
DATA : wa_isctrl TYPE bapi1001004_qmat,
it_isctrl TYPE TABLE OF bapi1001004_qmat,
it_ret TYPE TABLE OF bapiret2,
wa_ret TYPE bapiret2.
DATA: t_error TYPE STANDARD TABLE OF ty_error WITH HEADER LINE.
DATA: t_success TYPE STANDARD TABLE OF ty_success WITH HEADER LINE.
DATA: message(1024).

"******************************************************************************
"************** Data Declaration for BDC J1ID *********************************
TYPES: BEGIN OF ty_error_j1id,
error_txt(480),
END OF ty_error_j1id.
TYPES: BEGIN OF ty_success_j1id,
matnr TYPE matnr,
werks TYPE werks,
END OF ty_success_j1id.
DATA: ibdc LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA : l_mode LIKE ctu_params-dismode VALUE 'N'.
DATA: t_error_j1id TYPE STANDARD TABLE OF ty_error_j1id WITH HEADER LINE.
DATA: t_success_j1id TYPE STANDARD TABLE OF ty_success_j1id WITH HEADER LINE.
DATA: lm_string(480).

"******************************************************************************
"********************Data Declaration For BAPI BAPI_OBJCL_CREATE **************
DATA :wa_objectkeynew TYPE bapi1003_key-object,
wa_objecttablenew TYPE bapi1003_key-objecttable,
wa_classnumnew TYPE bapi1003_key-classnum,
wa_classtypenew TYPE bapi1003_key-classtype,
wa_status TYPE bapi1003_key-status,
wa_standardclass TYPE bapi1003_key-stdclass,
wa_changenumber TYPE bapi1003_key-changenumber,
wa_keydate TYPE bapi1003_key-keydate,
wa_no_default_values TYPE bapi1003_key-flag.
DATA : it_allocvaluesnum TYPE TABLE OF bapi1003_alloc_values_num,
it_allocvalueschar TYPE TABLE OF bapi1003_alloc_values_char,
it_allocvaluescurr TYPE TABLE OF bapi1003_alloc_values_curr,
it_ret2 TYPE TABLE OF bapiret2.
DATA : wa_allocvaluesnum TYPE bapi1003_alloc_values_num,
wa_allocvalueschar TYPE bapi1003_alloc_values_char,
wa_allocvaluescurr TYPE bapi1003_alloc_values_curr,
wa_ret2 TYPE bapiret2.

DATA: t_error_bapi_objcl_create TYPE STANDARD TABLE OF ty_error WITH HEADER LINE


.
DATA: t_success_bapi_objcl_create TYPE STANDARD TABLE OF ty_success WITH HEADER
LINE.

"******************************************************************************
DATA: it_excel TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.

TYPES : BEGIN OF ty_log,


matnr TYPE mara-matnr,
werks(5),
vkorg(10),
log1(1024),
log2(100),
log3(100),
log4(100),
END OF ty_log.
DATA : it_log TYPE STANDARD TABLE OF ty_log,
wa_log TYPE ty_log.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.


PARAMETERS : pa_file LIKE rlgrap-filename.
PARAMETERS: l_test AS CHECKBOX DEFAULT ''.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = pa_file.
START-OF-SELECTION.
PERFORM upload.
PERFORM download.
* PERFORM DISPLAYLOG2.
*&---------------------------------------------------------------------*
*& Form UPLOAD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM upload .
IF pa_file IS INITIAL.
MESSAGE 'Kindly select file' TYPE 'E'.
ENDIF.
* This uploads data from excel sheet to it_excel internal table
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = pa_file
i_begin_col = '1'
i_begin_row = '2'
i_end_col = '200'
i_end_row = '65000'
TABLES
intern = it_excel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF NOT it_excel[] IS INITIAL.
LOOP AT it_excel.
CASE it_excel-col.
WHEN '0001'.
wa_common-matnr = it_excel-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_common-matnr
IMPORTING
output = wa_common-matnr.

CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'


EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-matnr.

WHEN '0002'.
wa_common-mbrsh = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-mbrsh.

WHEN '0003'.
wa_common-mtart = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-mtart.
WHEN '0004'.
wa_common-werks_d = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-werks_d.
WHEN '0005'.
wa_common-lgort_d = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-lgort_d.
WHEN '0006'.
wa_common-vkorg = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-vkorg.
WHEN '0007'.
wa_common-vtweg = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-vtweg.
WHEN '0008'.
wa_common-maktx = it_excel-value.
WHEN '0009'.
wa_common-meins = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-meins.
WHEN '00010'.
wa_common-matkl = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-matkl.
WHEN '00011'.
wa_common-bismt = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-bismt.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_common-bismt
IMPORTING
output = wa_common-bismt.
WHEN '00012'.
wa_common-extwg = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-extwg.
WHEN '00013'.
wa_common-spart = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-spart.
WHEN '00014'.
wa_common-labor = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-labor.
WHEN '00015'.
wa_common-prodh_d = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-prodh_d.
WHEN '00016'.
wa_common-mstae = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-mstae.
WHEN '00017'.
wa_common-mtpos = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-mtpos.
WHEN '00018'.
wa_common-brgew = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-brgew.
WHEN '00019'.
wa_common-gewei = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-gewei.
WHEN '00020'.
wa_common-ntgew = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-ntgew.
WHEN '00021'.
wa_common-volum = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-volum.
WHEN '00022'.
wa_common-voleh = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-voleh.
WHEN '00023'.
wa_common-ferth = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ferth.
WHEN '00024'.
wa_common-wrkst = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-wrkst.
WHEN '00025'.
wa_common-sktof = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-sktof.
WHEN '00026'.
wa_common-taxkm1 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-taxkm1.
WHEN '00027'.
wa_common-taxkm2 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-taxkm2.
WHEN '00028'.
wa_common-taxkm3 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-taxkm3.
WHEN '00029'.
wa_common-taxkm4 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-taxkm4.
WHEN '00030'.
wa_common-taxkm5 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-taxkm5.
WHEN '00031'.
wa_common-taxkm6 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-taxkm6.
WHEN '00032'.
wa_common-taxkm7 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-taxkm7.
WHEN '00033'.
wa_common-taxkm8 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-taxkm8.
WHEN '00034'.
wa_common-stgma = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-stgma.
WHEN '00035'.
wa_common-kondm = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-kondm.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_common-kondm
IMPORTING
output = wa_common-kondm.
WHEN '00036'.
wa_common-ktgrm = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ktgrm.
WHEN '00037'.
wa_common-mtpos_mara = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-mtpos_mara.
WHEN '00038'.
wa_common-prodh_d2 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-prodh_d2.
WHEN '00039'.
wa_common-provg = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-provg.
WHEN '00040'.
wa_common-mvgr1 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-mvgr1.
WHEN '00041'.
wa_common-mvgr2 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-mvgr2.
WHEN '00042'.
wa_common-mvgr3 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-mvgr3.
WHEN '00043'.
wa_common-mtvfp = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-mtvfp.
WHEN '00044'.
wa_common-uchkz = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-uchkz.
WHEN '00045'.
wa_common-tragr = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-tragr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_common-tragr
IMPORTING
output = wa_common-tragr.
WHEN '00046'.
wa_common-ladgr = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ladgr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_common-ladgr
IMPORTING
output = wa_common-ladgr.
WHEN '00047'.
wa_common-prctr = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-prctr.
WHEN '00048'.
wa_common-ekgrp = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ekgrp.
WHEN '00049'.
wa_common-kautb = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-kautb.
WHEN '00050'.
wa_common-ekwsl = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ekwsl.
WHEN '00051'.
wa_common-webaz = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-webaz.
WHEN '00052'.
wa_common-bapiupdate = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-bapiupdate.
WHEN '00053'.
wa_common-usequ = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-usequ.
WHEN '00054'.
wa_common-kordb = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-kordb.
WHEN '00055'.
wa_common-maabc = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-maabc.
WHEN '00056'.
wa_common-mmsta = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-mmsta.
WHEN '00057'.
wa_common-dismm = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-dismm.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_common-dismm
IMPORTING
output = wa_common-dismm.
WHEN '00058'.
wa_common-minbe = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-minbe.
WHEN '00059'.
wa_common-fxhor = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-fxhor.
WHEN '00060'.
wa_common-dispo = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-dispo.
WHEN '00061'.
wa_common-bstmi = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-bstmi.
WHEN '00062'.
wa_common-bstma = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-bstma.
WHEN '00063'.
wa_common-disls = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-disls.
WHEN '00064'.
wa_common-bstfe = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-bstfe.
WHEN '00065'.
wa_common-ausss = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-ausss.
WHEN '00066'.
wa_common-takzt = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-takzt.
WHEN '00067'.
wa_common-bstrf = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-bstrf.
WHEN '00068'.
wa_common-beskz = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-beskz.
WHEN '00069'.
wa_common-kzech = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-kzech.
WHEN '00070'.
wa_common-sobsl = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-sobsl.
WHEN '00071'.
wa_common-lgort_d1 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-lgort_d1.
WHEN '00072'.
wa_common-lgfsb = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-lgfsb.
WHEN '00073'.
* wa_common-j_1bownpro = it_excel-value.
wa_common-dzeit = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-dzeit.
WHEN '00074'.
wa_common-plifz = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-plifz.
WHEN '00075'.
wa_common-fhori = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-fhori.
WHEN '00076'.
wa_common-eisbe = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-lgort_d.
WHEN '00077'.
wa_common-rwpro = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-rwpro.
WHEN '00078'.
wa_common-perkz = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-perkz.
WHEN '00079'.
wa_common-strgr = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-strgr.
WHEN '00080'.
* wa_common-modaw = it_excel-value.
wa_common-altsl = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-altsl.
WHEN '00081'.
wa_common-sbdkz = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-sbdkz.
WHEN '00082'.
wa_common-lminb = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-lminb.
WHEN '00083'.
wa_common-fevor = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-fevor.
WHEN '00084'.
wa_common-co_prodprf = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-co_prodprf.
WHEN '00085'.
wa_common-umren = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-umren.
WHEN '00086'.
wa_common-lzeih = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-lzeih.
WHEN '00087'.
wa_common-umrez = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-umrez.

WHEN '00088'.
wa_common-meins2 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-meins2.

*****************************************
WHEN '00089'.
wa_common-umren3 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-umren3.
WHEN '00090'.
wa_common-lzeih3 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-lzeih3.
WHEN '00091'.
wa_common-umrez3 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-umrez3.

WHEN '00092'.
wa_common-meins3 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-meins3.
**********************************

WHEN '00093'.
wa_common-lgpbe = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-lgpbe.
WHEN '00094'.
wa_common-abcin = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-abcin.
WHEN '00095'.
wa_common-maxlz = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-maxlz.
WHEN '00096'.
wa_common-mhdrz = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-mhdrz.
WHEN '00097'.
wa_common-mhdhb = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-mhdhb.
WHEN '00098'.
wa_common-dattp = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-dattp.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_common-dattp
IMPORTING
output = wa_common-dattp.
CALL FUNCTION 'CONVERSION_EXIT_PERKZ_INPUT'
EXPORTING
input = wa_common-dattp
IMPORTING
output = wa_common-dattp.

WHEN '00099'.
wa_common-lzeih2 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-lzeih2.
WHEN '000100'.
wa_common-qmatauth = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-qmatauth.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_common-qmatauth
IMPORTING
output = wa_common-qmatauth.
WHEN '000101'.
wa_common-kzdkz = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-kzdkz.
WHEN '000102'.
wa_common-prfrq = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-prfrq.
WHEN '000103'.
wa_common-qmpur = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-qmpur.
WHEN '000104'.
wa_common-qsspur = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-qsspur.
WHEN '000105'.
wa_common-qzgtyp = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-qzgtyp.
WHEN '000106'.
wa_common-bwtty_d = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-bwtty_d.
WHEN '000107'.
wa_common-bklas = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-bklas.
WHEN '000108'.
wa_common-vprsv = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-vprsv.
WHEN '000109'.
wa_common-peinh = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-peinh.
WHEN '000110'.
wa_common-verpr_bapi = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-verpr_bapi.
WHEN '000111'.
wa_common-xlifo = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-xlifo.
WHEN '000112'.
wa_common-ck_no_costing = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ck_no_costing.
WHEN '000113'.
wa_common-ck_ekalrel = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ck_ekalrel.
WHEN '000114'.
wa_common-j_1bmatorg = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-j_1bmatorg.
WHEN '000115'.
wa_common-hkmat = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-hkmat.
WHEN '000116'.
wa_common-ck_kosgr = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ck_kosgr.
WHEN '000117'.
wa_common-awsls = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-awsls.
WHEN '000118'.
wa_common-ck_sobsl = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ck_sobsl.
WHEN '000119'.
wa_common-ck_losgr = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-ck_losgr.
WHEN '000120'.
wa_common-dzplpr_bapi = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-dzplpr_bapi.
WHEN '000121'.
* wa_common-dzpld1 = it_excel-value.
CONCATENATE it_excel-value+6(4) it_excel-value+3(2) it_excel-value+0(2
) INTO wa_common-dzpld1.

WHEN '000122'.
wa_common-vrkme = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-vrkme.
WHEN '000123'.
wa_common-j_1ichid = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-j_1ichid.
WHEN '000124'.
wa_common-klassenart = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-klassenart.
WHEN '000125'.
wa_common-steuc = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-steuc.
WHEN '000126'.
wa_common-j_1icapind = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-j_1icapind.
WHEN '000127' .
wa_common-qmpdau = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-qmpdau.
WHEN '000128'.
wa_common-qpart1 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-qpart1.
WHEN '000129'.
wa_common-qpart2 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-qpart2.
WHEN '000130'.
wa_common-qpart3 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-qpart3.
WHEN '000131'.
wa_common-qpart4 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-qpart4.
WHEN '000132'.
wa_common-qpart5 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-qpart5.
WHEN '000133'.
wa_common-maktx_t = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-maktx_t.
WHEN '000134'.
wa_common-sale_text = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-sale_text.
WHEN '000135'.
wa_common-sale_text2 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-sale_text2.
WHEN '000136'.
wa_common-whse_no = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-whse_no.
WHEN '000137'.
wa_common-withdrawal = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-withdrawal.
WHEN '000138'.
wa_common-placement = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-placement.
WHEN '000139'.
wa_common-whse_no1 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-whse_no1.
WHEN '000140'.
wa_common-withdrawal1 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-withdrawal1.
WHEN '000141'.
wa_common-placement1 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-placement1.
WHEN '000142'.
wa_common-ean11 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ean11.
WHEN '000143'.
wa_common-meinh = it_excel-value.
* CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
* EXPORTING
* input = wa_common-meinh
* language = sy-langu
* IMPORTING
* output = wa_common-meinh
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-meinh.
WHEN '000144'.
wa_common-numtp = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-numtp.
WHEN '000145'.
wa_common-ean11_1 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ean11_1.
WHEN '000146'.
wa_common-meinh_1 = it_excel-value.
* CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
* EXPORTING
* input = wa_common-meinh_1
* language = sy-langu
* IMPORTING
* output = wa_common-meinh_1
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-meinh_1.
WHEN '000147'.
wa_common-numtp_1 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-numtp_1.
WHEN '000148'.
wa_common-ean11_2 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-ean11_2.
WHEN '000149'.
wa_common-meinh_2 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-meinh_2.
* CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
* EXPORTING
* input = wa_common-meinh_2
* language = sy-langu
* IMPORTING
* output = wa_common-meinh_2
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.
WHEN '000150'.
wa_common-numtp_2 = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-numtp_2.
WHEN '000151'.
wa_common-dwerk = it_excel-value.
CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
EXPORTING
im_no_spesym = 'X'
CHANGING
ch_text = wa_common-dwerk.

* WHEN '000155'.
* wa_common-meins4 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-meins4.
WHEN '000152'.
wa_common-LENGTH1 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-LENGTH.
WHEN '000153'.
wa_common-WIDTH1 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-WIDTH.
WHEN '000154'.
wa_common-HEIGHT1 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-HEIGHT.
WHEN '000155'.
wa_common-UNIT_DIM1 = it_excel-value.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-UNIT_DIM1
LANGUAGE = SY-LANGU
IMPORTING
OUTPUT = wa_common-UNIT_DIM1
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-UNIT_DIM.
****
WHEN '000156'.
wa_common-LENGTH2 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-LENGTH.
WHEN '000157'.
wa_common-WIDTH2 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-WIDTH.
WHEN '000158'.
wa_common-HEIGHT2 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-HEIGHT.
WHEN '000159'.
wa_common-UNIT_DIM2 = it_excel-value.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-UNIT_DIM2
LANGUAGE = SY-LANGU
IMPORTING
OUTPUT = wa_common-UNIT_DIM2
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-UNIT_DIM.
*********
WHEN '000160'.
wa_common-LENGTH = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-LENGTH.
WHEN '000161'.
wa_common-WIDTH = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-WIDTH.
WHEN '000162'.
wa_common-HEIGHT = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-HEIGHT.
WHEN '000163'.
wa_common-UNIT_DIM = it_excel-value.
*
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-UNIT_DIM
LANGUAGE = SY-LANGU
IMPORTING
OUTPUT = wa_common-UNIT_DIM
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-UNIT_DIM.
WHEN '000164'.
wa_common-umren4 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-umren4.
WHEN '000165'.
wa_common-lzeih4 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-lzeih4.
WHEN '000166'.
wa_common-umrez4 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-umrez4.

* WHEN '000159'.
* wa_common-GROSS_WT = it_excel-value.
** CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
** EXPORTING
** im_no_spesym = 'X'
** CHANGING
** ch_text = wa_common-GROSS_WT.
*
* WHEN '000160'.
* wa_common-UNIT_OF_WT = it_excel-value.
** CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
** EXPORTING
** im_no_spesym = 'X'
** CHANGING
** ch_text = wa_common-UNIT_OF_WT.
WHEN '000167'.
wa_common-ean11_3 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-ean11_3.
WHEN '000168'.
wa_common-meinh_3 = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-meinh_3.
WHEN '000169'.
wa_common-numtp_3 = it_excel-value.
WHEN '000170'.
wa_common-LENGTH4 = it_excel-value.
WHEN '000171'.
wa_common-WIDTH4 = it_excel-value.
WHEN '000172'.
wa_common-HEIGHT4 = it_excel-value.
WHEN '000173'.
wa_common-UNIT_DIM4 = it_excel-value.
WHEN '000174'.
wa_common-gross_wt1 = it_excel-value.
WHEN '000175'.
wa_common-gross_wt2 = it_excel-value.
WHEN '000176'.
wa_common-gross_wt3 = it_excel-value.
WHEN '000177'.
wa_common-FORMT = it_excel-value.
WHEN '000178'.
wa_common-STGESECTOR = it_excel-value.
WHEN '000179'.
wa_common-lgort_d2 = it_excel-value.

* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'


* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-numtp_3.

* WHEN '000170'.
* wa_common-PO_UNIT = it_excel-value.
* CALL FUNCTION 'HR_99S_CONV_UPPER_CASE'
* EXPORTING
* im_no_spesym = 'X'
* CHANGING
* ch_text = wa_common-PO_UNIT.

ENDCASE.
AT END OF row.
APPEND wa_common TO it_common.
CLEAR wa_common.
ENDAT.
CLEAR it_excel.
ENDLOOP.
ENDIF.
wa_log-matnr = 'MATERIAL'.
wa_log-log1 = ' Creation Status'.
wa_log-log2 = ' Quality Inspection Status'.
wa_log-log3 = ' Chapter ID*** '.
wa_log-log4 = ' Result'.
wa_log-werks = 'PLANT'.
wa_log-vkorg = 'SALES.ORG'.
APPEND wa_log TO it_log.
CLEAR : wa_log.
IF it_common[] IS INITIAL.
MESSAGE 'No data found' TYPE 'E'.
ENDIF.
DATA: ll_werks TYPE tvkwz-werks.
LOOP AT it_common INTO wa_common.
IF wa_common-whse_no1 NE ''.
wa_common-whse_no = wa_common-whse_no1.
wa_common-withdrawal = wa_common-withdrawal1.
wa_common-placement = wa_common-placement1.
wa_common-STGESECTOR = wa_common-STGESECTOR.
wa_common-whse_no1 = ''.
wa_common-withdrawal1 = ''.
wa_common-placement1 = ''.
wa_common-STGESECTOR = ''.
APPEND wa_common TO it_common.
ENDIF.
if wa_common-werks_d = '4302'.
if NOT wa_common-lgort_d2 is INITIAL.
wa_common-lgort_d = wa_common-lgort_d2.
wa_common-lgort_d2 = ''.
wa_common-whse_no = ''.
wa_common-withdrawal = ''.
wa_common-placement = ''.
wa_common-STGESECTOR = ''.
APPEND wa_common TO it_common.
ENDIF.
ENDIF.
ENDLOOP.
LOOP AT it_common INTO wa_common.
* check if sales org valid for plant.
SELECT SINGLE werks FROM tvkwz INTO ll_werks WHERE werks EQ wa_common-werks_
d AND vkorg EQ wa_common-vkorg.
IF sy-subrc NE 0.
t_error-type = 'E'.
t_error-message = ' Invalid sales org for plant'.
CONCATENATE t_error-message wa_common-werks_d INTO t_error-message SEPARAT
ED BY ''.
APPEND t_error.
wa_log-matnr = wa_common-matnr.
wa_log-werks = wa_common-werks_d.
wa_log-vkorg = wa_common-vkorg.
wa_log-log1 = t_error-message.
APPEND wa_log TO it_log.
i = i + 1.
CLEAR: t_error.
CONTINUE.
ENDIF.
* end of changes sales org for plant.
CLEAR: wa_headdata,wa_clientdata,wa_clientdatax,wa_plantdata,wa_plantdatax,w
a_forecastparameters,wa_forecastparametersx,
wa_planningdata,wa_planningdatax,wa_storagelocationdata,wa_storagelocationda
tax,wa_valuationdata,wa_valuationdatax,wa_warehousenumberdata,
wa_warehousenumberdatax,wa_salesdata,wa_salesdatax,wa_storagetypedata,wa_sto
ragetypedatax,wa_flag_online,wa_flag_cad_call,wa_no_dequeue,
wa_no_rollback_work,wa_isctrl,wa_ret,t_error,t_error_j1id,t_success_j1id,wa_
objecttablenew,
wa_classnumnew ,wa_classtypenew ,wa_status,wa_standardclass,wa_changenumber,
wa_keydate,wa_no_default_values, wa_allocvaluesnum,
wa_allocvalueschar ,wa_allocvaluescurr ,wa_ret2,wa_return,it_return[],it_ret
urn.

CLEAR: it_materialdescription,
wa_materialdescription,
it_unitsofmeasure,
wa_unitsofmeasure,
it_unitsofmeasurex,
wa_unitsofmeasurex,
it_internationalartnos,
wa_internationalartnos,
it_materiallongtext,
wa_materiallongtext,
it_taxclassifications,
wa_taxclassifications,
it_returnmessages,
wa_returnmessages,
it_prtdata,
wa_prtdata,
it_prtdatax,
wa_prtdatax,
it_extensionin,
wa_extensionin,
it_extensioninx,
wa_extensioninx,
it_isctrl[],
it_ret[],
t_error[],
t_error_j1id[],
t_success_j1id[],
it_allocvaluesnum[] ,
it_allocvalueschar[] ,
it_allocvaluescurr[],
it_ret2[].

* Headdata
wa_headdata-material = wa_common-matnr.
wa_headdata-ind_sector = wa_common-mbrsh.
wa_headdata-matl_type = wa_common-mtart.
**Selecting views
IF NOT wa_common-maktx IS INITIAL.
wa_headdata-basic_view = 'X'.
ENDIF.
IF NOT wa_common-taxkm1 IS INITIAL.
wa_headdata-sales_view = 'X'.
ENDIF.
IF NOT wa_common-ekgrp IS INITIAL.
wa_headdata-purchase_view = 'X'.
ENDIF.
IF NOT wa_common-dismm IS INITIAL.
wa_headdata-mrp_view = 'X'.
ENDIF.
*if not wa_common-dismm is INITIAL.
wa_headdata-work_sched_view = 'X'.
*ENDIF.
* wa_headdata-forecast_view = 'X'.
IF NOT wa_common-mhdrz IS INITIAL.
wa_headdata-storage_view = 'X'.
ENDIF.

wa_headdata-prt_view = 'X'.

IF NOT wa_common-whse_no IS INITIAL.


wa_headdata-warehouse_view = 'X'. ""Need to check
ENDIF.

wa_headdata-quality_view = 'X'. ""Need to check


IF NOT wa_common-vprsv IS INITIAL.
wa_headdata-account_view = 'X'.
ENDIF.

IF NOT wa_common-awsls IS INITIAL.


wa_headdata-cost_view = 'X'.
ENDIF.

* CLIENTDATA
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-meins
language = sy-langu
IMPORTING
output = wa_common-meins
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
wa_clientdata-matl_group = wa_common-matkl.
wa_clientdata-old_mat_no = wa_common-bismt.
wa_clientdata-base_uom = wa_common-meins.
wa_clientdata-base_uom_iso = wa_common-meins.
wa_clientdata-prod_memo = wa_common-ferth.
wa_clientdata-basic_matl = wa_common-wrkst.
wa_clientdata-pur_valkey = wa_common-ekwsl.
wa_clientdata-net_weight = wa_common-ntgew.
wa_clientdata-trans_grp = wa_common-tragr.
wa_clientdata-division = wa_common-spart.
wa_clientdata-prod_hier = wa_common-prodh_d.
wa_clientdata-minremlife = wa_common-mhdrz.
wa_clientdata-shelf_life = wa_common-mhdhb.
wa_clientdata-period_ind_expiration_date = wa_common-dattp.
wa_clientdata-item_cat = wa_common-mtpos.
wa_clientdata-extmatlgrp = wa_common-extwg.
wa_clientdata-dsn_office = wa_common-labor.
wa_clientdata-pur_status = wa_common-mstae.
wa_clientdata-batch_mgmt = 'X'.
wa_clientdata-qm_procmnt = wa_common-qmpur.
wa_clientdata-pageformat = wa_common-FORMT.
* wa_clientdata-PO_UNIT = wa_common-PO_UNIT.
* CLIENTDATAX
* wa_clientdatax-matl_group = 'X'.
* wa_clientdatax-base_uom_iso = 'X'.
* wa_clientdatax-pur_valkey = 'X'.
* wa_clientdatax-division = 'X'.
* wa_clientdatax-prod_hier = 'X'.
* wa_clientdatax-batch_mgmt = 'X'.
*wa_clientdatax-DEL_FLAG = 'X'.
wa_clientdatax-matl_group = 'X'.
wa_clientdatax-old_mat_no = 'X'.
wa_clientdatax-base_uom = 'X'.
wa_clientdatax-base_uom_iso = 'X'.
wa_clientdatax-po_unit = 'X'.
wa_clientdatax-po_unit_iso = 'X'.
wa_clientdatax-document = 'X'.
wa_clientdatax-doc_type = 'X'.
wa_clientdatax-doc_vers = 'X'.
wa_clientdatax-doc_format = 'X'.
wa_clientdatax-doc_chg_no = 'X'.
wa_clientdatax-page_no = 'X'.
wa_clientdatax-no_sheets = 'X'.
wa_clientdatax-prod_memo = 'X'.
wa_clientdatax-pageformat = 'X'.
wa_clientdatax-size_dim = 'X'.
wa_clientdatax-basic_matl = 'X'.
wa_clientdatax-std_descr = 'X'.
wa_clientdatax-dsn_office = 'X'.
wa_clientdatax-pur_valkey = 'X'.
wa_clientdatax-net_weight = 'X'.
*wa_clientdatax-UNIT_OF_WT = 'X'.
*wa_clientdatax-UNIT_OF_WT_ISO = 'X'.
wa_clientdatax-container = 'X'.
wa_clientdatax-stor_conds = 'X'.
wa_clientdatax-temp_conds = 'X'.
wa_clientdatax-trans_grp = 'X'.
wa_clientdatax-haz_mat_no = 'X'.
wa_clientdatax-division = 'X'.
wa_clientdatax-competitor = 'X'.
wa_clientdatax-qty_gr_gi = 'X'.
wa_clientdatax-proc_rule = 'X'.
wa_clientdatax-sup_source = 'X'.
wa_clientdatax-season = 'X'.
wa_clientdatax-label_type = 'X'.
wa_clientdatax-label_form = 'X'.
wa_clientdatax-prod_hier = 'X'.
wa_clientdatax-cad_id = 'X'.
wa_clientdatax-allowed_wt = 'X'.
wa_clientdatax-pack_wt_un = 'X'.
wa_clientdatax-pack_wt_un_iso = 'X'.
wa_clientdatax-allwd_vol = 'X'.
wa_clientdatax-pack_vo_un = 'X'.
wa_clientdatax-pack_vo_un_iso = 'X'.
wa_clientdatax-wt_tol_lt = 'X'.
wa_clientdatax-vol_tol_lt = 'X'.
wa_clientdatax-var_ord_un = 'X'.
wa_clientdatax-batch_mgmt = 'X'.
wa_clientdatax-sh_mat_typ = 'X'.
wa_clientdatax-fill_level = 'X'.
wa_clientdatax-stack_fact = 'X'.
wa_clientdatax-mat_grp_sm = 'X'.
wa_clientdatax-authoritygroup = 'X'.
wa_clientdatax-qm_procmnt = 'X'.
wa_clientdatax-catprofile = 'X'.
wa_clientdatax-minremlife = 'X'.
wa_clientdatax-shelf_life = 'X'.
wa_clientdatax-stor_pct = 'X'.
wa_clientdatax-pur_status = 'X'.
wa_clientdatax-sal_status = 'X'.
wa_clientdatax-pvalidfrom = 'X'.
wa_clientdatax-svalidfrom = 'X'.
wa_clientdatax-envt_rlvt = 'X'.
wa_clientdatax-prod_alloc = 'X'.
wa_clientdatax-qual_dik = 'X'.
wa_clientdatax-manu_mat = 'X'.
wa_clientdatax-mfr_no = 'X'.
wa_clientdatax-inv_mat_no = 'X'.
wa_clientdatax-manuf_prof = 'X'.
wa_clientdatax-hazmatprof = 'X'.
wa_clientdatax-high_visc = 'X'.
wa_clientdatax-looseorliq = 'X'.
wa_clientdatax-closed_box = 'X'.
wa_clientdatax-appd_b_rec = 'X'.
wa_clientdatax-matcmpllvl = 'X'.
wa_clientdatax-par_eff = 'X'.
wa_clientdatax-round_up_rule_expiration_date = 'X'.
wa_clientdatax-period_ind_expiration_date = 'X'.
wa_clientdatax-prod_composition_on_packaging = 'X'.
wa_clientdatax-item_cat = 'X'.
wa_clientdatax-haz_mat_no_external = 'X'.
wa_clientdatax-haz_mat_no_guid = 'X'.
wa_clientdatax-haz_mat_no_version = 'X'.
wa_clientdatax-inv_mat_no_external = 'X'.
wa_clientdatax-inv_mat_no_guid = 'X'.
wa_clientdatax-inv_mat_no_version = 'X'.
wa_clientdatax-material_fixed = 'X'.
wa_clientdatax-cm_relevance_flag = 'X'.
wa_clientdatax-sled_bbd = 'X'.
wa_clientdatax-gtin_variant = 'X'.
wa_clientdatax-serialization_level = 'X'.
wa_clientdatax-pl_ref_mat = 'X'.
wa_clientdatax-extmatlgrp = 'X'.
wa_clientdatax-uomusage = 'X'.
wa_clientdatax-gds_relevant = 'X'.
wa_clientdatax-pl_ref_mat_external = 'X'.
wa_clientdatax-pl_ref_mat_guid = 'X'.
wa_clientdatax-pl_ref_mat_version = 'X'.
wa_clientdatax-we_origin_acceptance = 'X'.
wa_clientdatax-std_hu_type = 'X'.
wa_clientdatax-pilferable = 'X'.
wa_clientdatax-whse_storage_condition = 'X'.
wa_clientdatax-whse_material_group = 'X'.
wa_clientdatax-handling_indicator = 'X'.
wa_clientdatax-haz_mat_relevant = 'X'.
wa_clientdatax-hu_type = 'X'.
wa_clientdatax-variable_tare_weight = 'X'.
wa_clientdatax-max_allowed_capacity = 'X'.
wa_clientdatax-overcapacity_tolerance = 'X'.
wa_clientdatax-max_allowed_length = 'X'.
wa_clientdatax-max_allowed_width = 'X'.
wa_clientdatax-max_allowed_heigth = 'X'.
wa_clientdatax-max_dimension_un = 'X'.
wa_clientdatax-max_dimension_un_iso = 'X'.
wa_clientdatax-countryori = 'X'.
wa_clientdatax-countryori_iso = 'X'.
wa_clientdatax-matfrgtgrp = 'X'.
wa_clientdatax-quarantine_period = 'X'.
wa_clientdatax-quarantine_period_un = 'X'.
wa_clientdatax-quarantine_period_un_iso = 'X'.
wa_clientdatax-quality_insp_grp = 'X'.
wa_clientdatax-serial_number_profile = 'X'.
wa_clientdatax-ewm_cw_tolerance_group = 'X'.
wa_clientdatax-ewm_cw_input_control = 'X'.
wa_clientdatax-pckging_smartform = 'X'.
wa_clientdatax-pacod = 'X'.
wa_clientdatax-dg_pckging_status = 'X'.
wa_clientdatax-adjust_profile = 'X'.
wa_clientdatax-ipmipproduct = 'X'.
wa_clientdatax-medium = 'X'.
wa_clientdatax-nsnid = 'X'.

* PLANTDATA
wa_plantdata-plant = wa_common-werks_d.
wa_plantdata-abc_id = wa_common-maabc.
wa_plantdata-crit_part = wa_common-bapiupdate.
wa_plantdata-pur_group = wa_common-ekgrp.
wa_plantdata-mrp_type = wa_common-dismm.
wa_plantdata-mrp_ctrler = wa_common-dispo.
wa_plantdata-plnd_delry = wa_common-plifz.
wa_plantdata-period_ind = wa_common-perkz.
wa_plantdata-lotsizekey = wa_common-disls.
wa_plantdata-proc_type = wa_common-beskz.
wa_plantdata-round_val = wa_common-bstrf.
wa_plantdata-alt_bom_id = wa_common-altsl. "wa_common-ALTSL not i
n input file need to check
wa_plantdata-loadinggrp = wa_common-ladgr.
wa_plantdata-batch_mgmt = 'X'. "Not in file
wa_plantdata-quotausage = wa_common-usequ.
wa_plantdata-availcheck = wa_common-mtvfp.
wa_plantdata-auto_p_ord = wa_common-kautb.
wa_plantdata-profit_ctr = wa_common-prctr.
wa_plantdata-lot_size = wa_common-ck_losgr.
wa_plantdata-fixed_lot = wa_common-bstfe.
wa_plantdata-assy_scrap = wa_common-ausss.
wa_plantdata-variance_key = wa_common-awsls.
wa_plantdata-insp_int = wa_common-prfrq.
wa_plantdata-plan_strgp = wa_common-strgr.
wa_plantdata-sloc_exprc = wa_common-lgfsb.
wa_plantdata-qm_authgrp = wa_common-qmatauth.
wa_plantdata-pur_status = wa_common-mmsta.
wa_plantdata-batchentry = wa_common-kzech.
wa_plantdata-sm_key = wa_common-fhori.
wa_plantdata-sourcelist = wa_common-kordb.
wa_plantdata-specprocty = wa_common-ck_sobsl.
wa_plantdata-covprofile = wa_common-rwpro.
wa_plantdata-prodprof = wa_common-co_prodprf.
wa_plantdata-cc_ph_inv = wa_common-abcin.
wa_plantdata-dep_req_id = wa_common-sbdkz.
wa_plantdata-stgeperiod = wa_common-maxlz.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-lzeih2
language = sy-langu
IMPORTING
output = wa_common-lzeih2
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

wa_plantdata-stge_pd_un = wa_common-lzeih2.
wa_plantdata-doc_reqd = wa_common-kzdkz.
wa_plantdata-ctrl_key = wa_common-qsspur.
wa_plantdata-cert_type = wa_common-qzgtyp.
wa_plantdata-no_costing = wa_common-ck_no_costing.
wa_plantdata-spproctype = wa_common-sobsl.
wa_plantdata-gr_pr_time = wa_common-webaz.
wa_plantdata-minlotsize = wa_common-bstmi.
wa_plantdata-maxlotsize = wa_common-bstma.
wa_plantdata-iss_st_loc = wa_common-lgort_d.
wa_plantdata-reorder_pt = wa_common-minbe.
wa_plantdata-safety_stk = wa_common-eisbe.
wa_plantdata-cycle_time = wa_common-takzt.
wa_plantdata-inhseprodt = wa_common-dzeit.
wa_plantdata-iss_st_loc = wa_common-lgort_d1.
wa_plantdata-pl_ti_fnce = wa_common-fxhor.
* IF wa_common-meins2 = 'CV'.
* wa_common-meins2 = 'CS'.
* ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-meins2
* LANGUAGE = SY-LANGU
IMPORTING
output = wa_common-meins2
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.

wa_plantdata-issue_unit = wa_common-meins2.
* PLANTDATAX
wa_plantdatax-plant = wa_common-werks_d.

* wa_plantdatax-pur_group = 'X'.
* wa_plantdatax-mrp_type = 'X'.
* wa_plantdatax-mrp_ctrler = 'X'.
* wa_plantdatax-lotsizekey = 'X'.
* wa_plantdatax-sm_key = 'X'.
* wa_plantdatax-loadinggrp = 'X'.
* wa_plantdatax-availcheck = 'X'.
* wa_plantdatax-profit_ctr = 'X'.
* wa_plantdatax-lot_size = 'X'.
* wa_plantdatax-PLANT = 'X'.
*wa_plantdatax-DEL_FLAG = 'X'.
wa_plantdatax-abc_id = 'X'.
wa_plantdatax-crit_part = 'X'.
wa_plantdatax-pur_group = 'X'.
wa_plantdatax-issue_unit = 'X'.
wa_plantdatax-issue_unit_iso = 'X'.
wa_plantdatax-mrpprofile = 'X'.
wa_plantdatax-mrp_type = 'X'.
wa_plantdatax-mrp_ctrler = 'X'.
wa_plantdatax-plnd_delry = 'X'.
wa_plantdatax-gr_pr_time = 'X'.
wa_plantdatax-period_ind = 'X'.
wa_plantdatax-assy_scrap = 'X'.
wa_plantdatax-lotsizekey = 'X'.
wa_plantdatax-proc_type = 'X'.
wa_plantdatax-spproctype = 'X'.
wa_plantdatax-reorder_pt = 'X'.
wa_plantdatax-safety_stk = 'X'.
wa_plantdatax-minlotsize = 'X'.
wa_plantdatax-maxlotsize = 'X'.
wa_plantdatax-fixed_lot = 'X'.
wa_plantdatax-round_val = 'X'.
wa_plantdatax-max_stock = 'X'.
wa_plantdatax-ord_costs = 'X'.
wa_plantdatax-dep_req_id = 'X'.
wa_plantdatax-stor_costs = 'X'.
wa_plantdatax-alt_bom_id = 'X'.
wa_plantdatax-discontinu = 'X'.
wa_plantdatax-eff_o_day = 'X'.
wa_plantdatax-follow_up = 'X'.
wa_plantdatax-grp_reqmts = 'X'.
wa_plantdatax-mixed_mrp = 'X'.
wa_plantdatax-sm_key = 'X'.
wa_plantdatax-backflush = 'X'.
wa_plantdatax-production_scheduler = 'X'.
wa_plantdatax-proc_time = 'X'.
wa_plantdatax-setuptime = 'X'.
wa_plantdatax-interop = 'X'.
wa_plantdatax-base_qty = 'X'.
wa_plantdatax-inhseprodt = 'X'.
wa_plantdatax-stgeperiod = 'X'.
wa_plantdatax-stge_pd_un = 'X'.
wa_plantdatax-stge_pd_un_iso = 'X'.
wa_plantdatax-over_tol = 'X'.
wa_plantdatax-unlimited = 'X'.
wa_plantdatax-under_tol = 'X'.
wa_plantdatax-replentime = 'X'.
wa_plantdatax-replace_pt = 'X'.
wa_plantdatax-ind_post_to_insp_stock = 'X'.
wa_plantdatax-ctrl_key = 'X'.
wa_plantdatax-doc_reqd = 'X'.
wa_plantdatax-loadinggrp = 'X'.
wa_plantdatax-batch_mgmt = 'X'.
wa_plantdatax-quotausage = 'X'.
wa_plantdatax-serv_level = 'X'.
wa_plantdatax-split_ind = 'X'.
wa_plantdatax-availcheck = 'X'.
wa_plantdatax-fy_variant = 'X'.
wa_plantdatax-corr_fact = 'X'.
wa_plantdatax-setup_time = 'X'.
wa_plantdatax-base_qty_plan = 'X'.
wa_plantdatax-ship_proc_time = 'X'.
wa_plantdatax-sup_source = 'X'.
wa_plantdatax-auto_p_ord = 'X'.
wa_plantdatax-sourcelist = 'X'.
wa_plantdatax-comm_code = 'X '.
wa_plantdatax-countryori = 'X'.
wa_plantdatax-countryori_iso = 'X'.
wa_plantdatax-regionorig = 'X'.
wa_plantdatax-comm_co_un = 'X'.
wa_plantdatax-comm_co_un_iso = 'X'.
wa_plantdatax-expimpgrp = 'X'.
wa_plantdatax-profit_ctr = 'X'.
wa_plantdatax-ppc_pl_cal = 'X'.
wa_plantdatax-rep_manuf = 'X'.
wa_plantdatax-pl_ti_fnce = 'X'.
wa_plantdatax-consummode = 'X'.
wa_plantdatax-bwd_cons = 'X'.
wa_plantdatax-fwd_cons = 'X'.
wa_plantdatax-alternative_bom = 'X'.
wa_plantdatax-bom_usage = 'X'.
wa_plantdatax-planlistgrp = 'X'.
wa_plantdatax-planlistcnt = 'X'.
wa_plantdatax-lot_size = 'X'.
wa_plantdatax-specprocty = 'X'.
wa_plantdatax-prod_unit = 'X'.
wa_plantdatax-prod_unit_iso = 'X'.
wa_plantdatax-iss_st_loc = 'X'.
wa_plantdatax-mrp_group = 'X'.
wa_plantdatax-comp_scrap = 'X'.
wa_plantdatax-cert_type = 'X'.
wa_plantdatax-cycle_time = 'X'.
wa_plantdatax-covprofile = 'X'.
wa_plantdatax-cc_ph_inv = 'X'.
wa_plantdatax-variance_key = 'X'.
wa_plantdatax-serno_prof = 'X'.
wa_plantdatax-repmanprof = 'X'.
wa_plantdatax-neg_stocks = 'X'.
wa_plantdatax-qm_rgmts = 'X'.
wa_plantdatax-plng_cycle = 'X'.
wa_plantdatax-round_prof = 'X'.
wa_plantdatax-refmatcons = 'X'.
wa_plantdatax-d_to_ref_m = 'X'.
wa_plantdatax-mult_ref_m = 'X'.
wa_plantdatax-auto_reset = 'X'.
wa_plantdatax-ex_cert_id = 'X'.
wa_plantdatax-ex_cert_no_new = 'X'.
wa_plantdatax-ex_cert_dt = 'X'.
wa_plantdatax-milit_id = 'X'.
wa_plantdatax-insp_int = 'X'.
wa_plantdatax-co_product = 'X'.
wa_plantdatax-plan_strgp = 'X'.
wa_plantdatax-sloc_exprc = 'X'.
wa_plantdatax-bulk_mat = 'X'.
wa_plantdatax-cc_fixed = 'X'.
wa_plantdatax-determ_grp = 'X'.
wa_plantdatax-qm_authgrp = 'X'.
wa_plantdatax-task_list_type = 'X'.
wa_plantdatax-pur_status = 'X'.
wa_plantdatax-prodprof = 'X'.
wa_plantdatax-safty_t_id = 'X'.
wa_plantdatax-safetytime = 'X'.
wa_plantdatax-plord_ctrl = 'X'.
wa_plantdatax-batchentry = 'X'.
wa_plantdatax-pvalidfrom = 'X'.
wa_plantdatax-matfrgtgrp = 'X'.
wa_plantdatax-prodverscs = 'X'.
wa_plantdatax-mat_cfop = 'X'.
wa_plantdatax-eu_list_no = 'X'.
wa_plantdatax-eu_mat_grp = 'X'.
wa_plantdatax-cas_no = 'X'.
wa_plantdatax-prodcom_no = 'X'.
wa_plantdatax-ctrl_code = 'X'.
wa_plantdatax-jit_relvt = 'X'.
wa_plantdatax-mat_grp_trans = 'X'.
wa_plantdatax-handlg_grp = 'X'.
wa_plantdatax-supply_area = 'X'.
wa_plantdatax-fair_share_rule = 'X'.
wa_plantdatax-push_distrib = 'X'.
wa_plantdatax-deploy_horiz = 'X'.
wa_plantdatax-min_lot_size = 'X'.
wa_plantdatax-max_lot_size = 'X'.
wa_plantdatax-fix_lot_size = 'X'.
wa_plantdatax-lot_increment = 'X'.
wa_plantdatax-prod_conv_type = 'X'.
wa_plantdatax-distr_prof = 'X'.
wa_plantdatax-period_profile_safety_time = 'X'.
wa_plantdatax-fxd_price = 'X'.
wa_plantdatax-avail_check_all_proj_segments = 'X'.
wa_plantdatax-overallprf = 'X'.
wa_plantdatax-mrp_relevancy_dep_requirements = 'X'.
wa_plantdatax-min_safety_stk = 'X'.
wa_plantdatax-no_costing = 'X'.
wa_plantdatax-unit_group = 'X'.
wa_plantdatax-follow_up_external = 'X'.
wa_plantdatax-follow_up_guid = 'X'.
wa_plantdatax-follow_up_version = 'X'.
wa_plantdatax-refmatcons_external = 'X'.
wa_plantdatax-refmatcons_guid = 'X'.
wa_plantdatax-refmatcons_version = 'X'.
wa_plantdatax-rotation_date = 'X'.
wa_plantdatax-original_batch_flag = 'X'.
wa_plantdatax-original_batch_ref_material = 'X'.
wa_plantdatax-original_batch_ref_material_e = 'X'.
wa_plantdatax-original_batch_ref_material_v = 'X'.
wa_plantdatax-original_batch_ref_material_g = 'X'.
wa_plantdatax-iuid_relevant = 'X'.
wa_plantdatax-iuid_type = 'X'.
wa_plantdatax-uid_iea = 'X'.

* FORECASTPARAMETERS
wa_forecastparameters-plant = wa_common-werks_d.
* FORECASTPARAMETERSX
wa_forecastparametersx-plant = wa_common-werks_d.
wa_forecastparametersx-fore_prof = 'X'.
wa_forecastparametersx-model_si = 'X'.
wa_forecastparametersx-model_sp = 'X'.
wa_forecastparametersx-param_opt = 'X'.
wa_forecastparametersx-optim_lev = 'X'.
wa_forecastparametersx-initialize = 'X'.
wa_forecastparametersx-fore_model = 'X'.
wa_forecastparametersx-alpha_fact = 'X'.
wa_forecastparametersx-beta_fact = 'X'.
wa_forecastparametersx-gamma_fact = 'X'.
wa_forecastparametersx-delta_fact = 'X'.
wa_forecastparametersx-tracklimit = 'X'.
wa_forecastparametersx-fore_date = 'X'.
wa_forecastparametersx-hist_vals = 'X'.
wa_forecastparametersx-init_pds = 'X'.
wa_forecastparametersx-season_pds = 'X'.
wa_forecastparametersx-expost_pds = 'X'.
wa_forecastparametersx-fore_pds = 'X'.
wa_forecastparametersx-fixed_pds = 'X'.
wa_forecastparametersx-wtg_group = 'X'.

* PLANNINGDATA
wa_planningdata-plant = wa_common-werks_d.
* PLANNINGDATAX
wa_planningdatax-plant = wa_common-werks_d.
wa_planningdatax-plng_matl = 'X'.
wa_planningdatax-plng_plant = 'X'.
wa_planningdatax-convfactor = 'X'.
wa_planningdatax-plng_matl_external = 'X'.
wa_planningdatax-plng_matl_guid = 'X'.
wa_planningdatax-plng_matl_version = 'X'.

* STORAGELOCATIONDATA
wa_storagelocationdata-plant = wa_common-werks_d.
wa_storagelocationdata-stge_loc = wa_common-lgort_d.
wa_storagelocationdata-reorder_pt = wa_common-lminb.
* STORAGELOCATIONDATAX
wa_storagelocationdatax-plant = wa_common-werks_d.
wa_storagelocationdatax-stge_loc = wa_common-lgort_d.
wa_storagelocationdatax-del_flag = 'X'.
wa_storagelocationdatax-mrp_ind = 'X'.
wa_storagelocationdatax-spec_proc = 'X'.
wa_storagelocationdatax-reorder_pt = 'X'.
wa_storagelocationdatax-repl_qty = 'X'.
wa_storagelocationdatax-stge_bin = 'X'.
wa_storagelocationdatax-pickg_area = 'X'.
wa_storagelocationdatax-inv_corr_fac = 'X'.

wa_valuationdata-val_area = wa_common-werks_d.
wa_valuationdata-price_ctrl = wa_common-vprsv. "duplicate"
wa_valuationdata-price_unit = wa_common-peinh.
wa_valuationdata-val_class = wa_common-bklas.
wa_valuationdata-pr_ctrl_pp = wa_common-vprsv. "duplicate"
wa_valuationdata-pr_ctrl_py = wa_common-vprsv. "duplicate"
wa_valuationdata-plndprdate1 = wa_common-dzpld1.
wa_valuationdata-plndprice1 = wa_common-dzplpr_bapi.
wa_valuationdata-moving_pr = wa_common-verpr_bapi.
wa_valuationdata-lifo_fifo = wa_common-xlifo.
wa_valuationdata-overhead_grp = wa_common-ck_kosgr.
wa_valuationdata-val_cat = wa_common-bwtty_d.
wa_valuationdata-qty_struct = wa_common-ck_ekalrel.
wa_valuationdata-orig_mat = wa_common-hkmat.
* VALUATIONDATAX
wa_valuationdatax-val_area = wa_common-werks_d.
wa_valuationdatax-price_unit = 'X'.
wa_valuationdatax-price_ctrl = 'X'.
wa_valuationdatax-val_class = 'X'.
wa_valuationdatax-pr_ctrl_pp = 'X'.
wa_valuationdatax-pr_ctrl_py = 'X'.
wa_valuationdatax-qty_struct = 'X'.
wa_valuationdatax-orig_mat = 'X'.
wa_valuationdatax-plndprdate1 = 'X'.
wa_valuationdatax-plndprice1 = 'X'.
wa_valuationdatax-moving_pr = 'X'.
wa_valuationdatax-lifo_fifo = 'X'.
wa_valuationdatax-overhead_grp = 'X'.
wa_valuationdatax-val_cat = 'X'.

** VALUATIONDATA
* wa_valuationdata-val_area = wa_common-werks_d.
* wa_valuationdata-price_ctrl = wa_common-vprsv. "duplicate"
* wa_valuationdata-price_unit = wa_common-peinh.
* wa_valuationdata-val_class = wa_common-bklas.
* wa_valuationdata-pr_ctrl_pp = wa_common-vprsv. "duplicate"
* wa_valuationdata-pr_ctrl_py = wa_common-vprsv. "duplicate"
* wa_valuationdata-plndprdate1 = wa_common-dzpld1.
* wa_valuationdata-qty_struct = 'X'.
* wa_valuationdata-orig_mat = 'X'.
** VALUATIONDATAX
* wa_valuationdatax-val_area = wa_common-werks_d.
* wa_valuationdatax-price_ctrl = 'X'.
* wa_valuationdatax-val_class = 'X'.
* wa_valuationdatax-pr_ctrl_pp = 'X'.
* wa_valuationdatax-pr_ctrl_py = 'X'.
* wa_valuationdatax-orig_mat = 'X'.
**
*** VALUATIONDATAX
* wa_valuationdatax-val_area = wa_common-werks_d.
* wa_valuationdatax-price_ctrl = 'X'.
* wa_valuationdatax-val_class = 'X'.
* wa_valuationdatax-pr_ctrl_pp = 'X'.
* wa_valuationdatax-pr_ctrl_py = 'X'.
* wa_valuationdatax-orig_mat = 'X'.
* wa_valuationdatax-VAL_AREA = 'X'.
*wa_valuationdatax-VAL_TYPE = 'X'.
*wa_valuationdatax-DEL_FLAG = 'X'.
*wa_valuationdatax-PRICE_CTRL = 'X'.
*wa_valuationdatax-MOVING_PR = 'X'.
*wa_valuationdatax-STD_PRICE = 'X'.
*wa_valuationdatax-PRICE_UNIT = 'X'.
*wa_valuationdatax-VAL_CLASS = 'X'.
*wa_valuationdatax-PR_CTRL_PP = 'X'.
*wa_valuationdatax-MOV_PR_PP = 'X'.
*wa_valuationdatax-STD_PR_PP = 'X'.
*wa_valuationdatax-PR_UNIT_PP = 'X'.
*wa_valuationdatax-VCLASS_PP = 'X'.
*wa_valuationdatax-PR_CTRL_PY = 'X'.
*wa_valuationdatax-MOV_PR_PY = 'X'.
*wa_valuationdatax-STD_PR_PY = 'X'.
*wa_valuationdatax-VCLASS_PY = 'X'.
*wa_valuationdatax-PR_UNIT_PY = 'X'.
*wa_valuationdatax-FUTURE_PR = 'X'.
*wa_valuationdatax-VALID_FROM = 'X'.
*wa_valuationdatax-TAXPRICE_1 = 'X'.
*wa_valuationdatax-COMMPRICE1 = 'X'.
*wa_valuationdatax-TAXPRICE_3 = 'X'.
*wa_valuationdatax-COMMPRICE3 = 'X'.
*wa_valuationdatax-PLND_PRICE = 'X'.
*wa_valuationdatax-PLNDPRICE1 = 'X'.
*wa_valuationdatax-PLNDPRICE2 = 'X'.
*wa_valuationdatax-PLNDPRICE3 = 'X'.
*wa_valuationdatax-PLNDPRDATE1 = 'X'.
*wa_valuationdatax-PLNDPRDATE2 = 'X'.
*wa_valuationdatax-PLNDPRDATE3 = 'X'.
*wa_valuationdatax-LIFO_FIFO = 'X'.
*wa_valuationdatax-POOLNUMBER = 'X'.
*wa_valuationdatax-TAXPRICE_2 = 'X'.
*wa_valuationdatax-COMMPRICE2 = 'X'.
*wa_valuationdatax-DEVAL_IND = 'X'.
*wa_valuationdatax-ORIG_GROUP = 'X'.
*wa_valuationdatax-OVERHEAD_GRP = 'X'.
*wa_valuationdatax-QTY_STRUCT = 'X'.
*wa_valuationdatax-ML_ACTIVE = 'X'.
*wa_valuationdatax-ML_SETTLE = 'X'.
*wa_valuationdatax-ORIG_MAT = 'X'.
*wa_valuationdatax-VM_SO_STK = 'X'.
*wa_valuationdatax-VM_P_STOCK = 'X'.
*wa_valuationdatax-MATL_USAGE = 'X'.
*wa_valuationdatax-MAT_ORIGIN = 'X'.
*wa_valuationdatax-IN_HOUSE = 'X'.
*wa_valuationdatax-TAX_CML_UN = 'X'.
*warehousenummberdata
wa_warehousenumberdata-whse_no = wa_common-whse_no.
wa_warehousenumberdata-withdrawal = wa_common-withdrawal.
wa_warehousenumberdata-placement = wa_common-placement.
wa_warehousenumberdata-STGESECTOR = wa_common-STGESECTOR.

wa_warehousenumberdatax-whse_no = wa_common-whse_no.
wa_warehousenumberdatax-withdrawal = 'X'.
wa_warehousenumberdatax-placement = 'X'.
wa_warehousenumberdatax-stgesector = 'X'.

* SALESDATA
wa_salesdata-sales_org = wa_common-vkorg.
wa_salesdata-distr_chan = wa_common-vtweg.
wa_salesdata-matl_stats = wa_common-stgma.
wa_salesdata-item_cat = wa_common-mtpos_mara.
wa_salesdata-comm_group = wa_common-provg.
* IF wa_common-vrkme = 'CV'.
* wa_common-vrkme = 'CS'.
* ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-vrkme
* LANGUAGE = SY-LANGU
IMPORTING
output = wa_common-vrkme
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.
* IF sy-subrc <> 0.
** Implement suitable error handling here
* ENDIF.

wa_salesdata-sales_unit = wa_common-vrkme.
wa_salesdata-mat_pr_grp = wa_common-kondm.
wa_salesdata-matl_grp_1 = wa_common-mvgr1.
wa_salesdata-matl_grp_3 = wa_common-mvgr3.
wa_salesdata-cash_disc = wa_common-sktof.
wa_salesdata-acct_assgt = wa_common-ktgrm.
wa_salesdata-matl_grp_2 = wa_common-mvgr2.
wa_salesdata-prod_hier = wa_common-prodh_d2.
wa_salesdata-delyg_plnt = wa_common-dwerk.
* SALESDATAX
wa_salesdatax-sales_org = wa_common-vkorg.
wa_salesdatax-distr_chan = wa_common-vtweg.
wa_salesdatax-item_cat = 'X'.
* wa_salesdatax-SALES_ORG = 'X'.
*wa_salesdatax-DISTR_CHAN = 'X'.
*wa_salesdatax-DEL_FLAG = 'X'.
wa_salesdatax-matl_stats = 'X'.
*wa_salesdatax-REBATE_GRP = 'X'.
wa_salesdatax-comm_group = 'X'.
wa_salesdatax-cash_disc = 'X'.
wa_salesdatax-acct_assgt = 'X'.
*wa_salesdatax-SAL_STATUS = 'X'.
*wa_salesdatax-VALID_FROM = 'X'.
*wa_salesdatax-MIN_ORDER = 'X'.
*wa_salesdatax-MIN_DELY = 'X'.
*wa_salesdatax-MIN_MTO = 'X'.
*wa_salesdatax-DELY_UNIT = 'X'.
*wa_salesdatax-DELY_UOM = 'X'.
*wa_salesdatax-DELY_UOM_ISO = 'X'.
wa_salesdatax-sales_unit = 'X'.
*wa_salesdatax-SALES_UNIT_ISO = 'X'.
*wa_salesdatax-ITEM_CAT = 'X'.
*wa_salesdatax-DELYG_PLNT = 'X'.
wa_salesdatax-prod_hier = 'X'.
*wa_salesdatax-PR_REF_MAT = 'X'.
wa_salesdatax-mat_pr_grp = 'X'.
*wa_salesdatax-ACCT_ASSGT = 'X'.
wa_salesdatax-matl_grp_1 = 'X'.
wa_salesdatax-matl_grp_2 = 'X'.
*wa_salesdatax-MATL_GRP_2 = 'X'.
wa_salesdatax-matl_grp_3 = 'X'.
wa_salesdatax-delyg_plnt = 'X'.
*wa_salesdatax-MATL_GRP_4 = 'X'.
*wa_salesdatax-MATL_GRP_5 = 'X'.
*wa_salesdatax-PROD_ATT_1 = 'X'.
*wa_salesdatax-PROD_ATT_2 = 'X'.
*wa_salesdatax-PROD_ATT_3 = 'X'.
*wa_salesdatax-PROD_ATT_4 = 'X'.
*wa_salesdatax-PROD_ATT_5 = 'X'.
*wa_salesdatax-PROD_ATT_6 = 'X'.
*wa_salesdatax-PROD_ATT_7 = 'X'.
*wa_salesdatax-PROD_ATT_8 = 'X'.
*wa_salesdatax-PROD_ATT_9 = 'X'.
*wa_salesdatax-PROD_ATT10 = 'X'.
*wa_salesdatax-ROUND_PROF = 'X'.
*wa_salesdatax-VAR_SALES_UN = 'X'.
*wa_salesdatax-UNIT_GROUP = 'X'.
*wa_salesdatax-PR_REF_MAT_EXTERNAL = 'X'.
*wa_salesdatax-PR_REF_MAT_GUID = 'X'.
*wa_salesdatax-PR_REF_MAT_VERSION = 'X'.

* MATERIALDESCRIPTION
wa_materialdescription-langu = 'EN'. "Hardcoaded"
wa_materialdescription-langu_iso = 'EN'. "hardcoaded"
wa_materialdescription-matl_desc = wa_common-maktx.
APPEND wa_materialdescription TO it_materialdescription.
CLEAR: wa_materialdescription.
IF NOT wa_common-maktx_t IS INITIAL.
wa_materialdescription-langu = 'TR'. "Hardcoaded"
wa_materialdescription-langu_iso = 'TR'. "hardcoaded"
wa_materialdescription-matl_desc = wa_common-maktx_t.
APPEND wa_materialdescription TO it_materialdescription.
CLEAR: wa_materialdescription.
ENDIF.

* UNITSOFMEASURE
* IF wa_common-lzeih = 'CV'.
* wa_common-lzeih = 'CS'.
* ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-lzeih
language = sy-langu
IMPORTING
output = wa_common-lzeih
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

* IF wa_common-lzeih3 = 'TS'.
* wa_common-lzeih3 = 'TH'.
* ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-lzeih3
language = sy-langu
IMPORTING
output = wa_common-lzeih3
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.

IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-lzeih4
language = sy-langu
IMPORTING
output = wa_common-lzeih4
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.

CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'


EXPORTING
input = wa_common-meinh_1
language = sy-langu
IMPORTING
output = wa_common-meinh_1
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

* if wa_common-lzeih =
IF NOT wa_common-meins IS INITIAL.
* IF wa_common-meinh = wa_common-meins.
IF wa_common-meins = wa_common-meinh.
numtp_t = wa_common-numtp.
ean11_t = wa_common-ean11.
ELSE.
IF wa_common-meins = wa_common-meinh_1.
numtp_t = wa_common-numtp_1.
ean11_t = wa_common-ean11_1.
ENDIF.
ENDIF.
ENDIF.
wa_unitsofmeasure-alt_unit = wa_common-meins.
wa_unitsofmeasure-alt_unit_iso = wa_common-meins.
wa_unitsofmeasure-numerator = '1'.
wa_unitsofmeasure-denominatr = '1'.
wa_unitsofmeasure-volume = wa_common-volum.
wa_unitsofmeasure-volumeunit = wa_common-voleh.
wa_unitsofmeasure-gross_wt = wa_common-brgew.
wa_unitsofmeasure-unit_of_wt = wa_common-gewei.
wa_unitsofmeasure-ean_cat = numtp_t.
wa_unitsofmeasure-ean_upc = ean11_t.
wa_unitsofmeasure-LENGTH = wa_common-LENGTH1.
wa_unitsofmeasure-WIDTH = wa_common-WIDTH1.
wa_unitsofmeasure-HEIGHT = wa_common-HEIGHT1.
wa_unitsofmeasure-UNIT_DIM = wa_common-UNIT_DIM1.
APPEND wa_unitsofmeasure TO it_unitsofmeasure.
CLEAR:wa_unitsofmeasure,numtp_t,ean11_t.

IF NOT wa_common-meinh_1 IS INITIAL.


* IF wa_common-meinh_1 EQ 'CV'.
* wa_common-meinh_1 = 'CS'.
* ENDIF.
* CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
* EXPORTING
* input = wa_common-meinh_1
* language = sy-langu
* IMPORTING
* output = wa_common-meinh_1
** EXCEPTIONS
** UNIT_NOT_FOUND = 1
** OTHERS = 2
* .
* IF sy-subrc <> 0.
** Implement suitable error handling here
* ENDIF.
IF wa_common-lzeih = wa_common-meinh_1.
* meinh_t = wa_common-meinh.
numtp_t = wa_common-numtp_1.
ean11_t = wa_common-ean11_1.
ELSE.
IF wa_common-lzeih = wa_common-meinh.
numtp_t = wa_common-numtp.
ean11_t = wa_common-ean11.
ENDIF.
ENDIF.
ENDIF.
IF NOT wa_common-lzeih IS INITIAL.
wa_unitsofmeasure-alt_unit = wa_common-lzeih.
wa_unitsofmeasure-alt_unit_iso = wa_common-lzeih.
wa_unitsofmeasure-numerator = wa_common-umrez.
wa_unitsofmeasure-denominatr = wa_common-umren.
wa_unitsofmeasure-volume = wa_common-volum * wa_common-umrez.
wa_unitsofmeasure-volumeunit = wa_common-voleh.
if wa_common-werks_d = '4001' or wa_common-werks_d = '4201'.
wa_unitsofmeasure-gross_wt = wa_common-gross_wt1.
else.
wa_unitsofmeasure-gross_wt = wa_common-brgew * wa_common-umrez.
endif.
wa_unitsofmeasure-unit_of_wt = wa_common-gewei.
wa_unitsofmeasure-ean_cat = numtp_t.
wa_unitsofmeasure-ean_upc = ean11_t.
wa_unitsofmeasure-LENGTH = wa_common-LENGTH2.
wa_unitsofmeasure-WIDTH = wa_common-WIDTH2.
wa_unitsofmeasure-HEIGHT = wa_common-HEIGHT2.
wa_unitsofmeasure-UNIT_DIM = wa_common-UNIT_DIM2.
APPEND wa_unitsofmeasure TO it_unitsofmeasure.
CLEAR:wa_unitsofmeasure,numtp_t,ean11_t.
ENDIF.
IF NOT wa_common-lzeih3 IS INITIAL.
* IF wa_common-meinh_2 EQ 'TS'.
* wa_common-meinh_2 = 'TH'.
* ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = wa_common-meinh_2
language = sy-langu
IMPORTING
output = wa_common-meinh_2
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
IF wa_common-meinh_2 = wa_common-lzeih3.
* meinh_t = wa_common-meinh.
numtp_t = wa_common-numtp_2.
ean11_t = wa_common-ean11_2.
ENDIF.
ENDIF.
IF NOT wa_common-lzeih3 IS INITIAL.
wa_unitsofmeasure-alt_unit = wa_common-lzeih3.
wa_unitsofmeasure-alt_unit_iso = wa_common-lzeih3.
wa_unitsofmeasure-numerator = wa_common-umrez3.
wa_unitsofmeasure-denominatr = wa_common-umren3.
wa_unitsofmeasure-volume = wa_common-volum * wa_common-umrez3.
wa_unitsofmeasure-volumeunit = wa_common-voleh.
if wa_common-werks_d = '4001' or wa_common-werks_d = '4201'.
wa_unitsofmeasure-gross_wt = wa_common-gross_wt2.
else.
wa_unitsofmeasure-gross_wt = wa_common-brgew * wa_common-umrez3.
endif.
wa_unitsofmeasure-unit_of_wt = wa_common-gewei.
wa_unitsofmeasure-ean_cat = numtp_t.
wa_unitsofmeasure-ean_upc = ean11_t.
wa_unitsofmeasure-LENGTH = wa_common-LENGTH.
wa_unitsofmeasure-WIDTH = wa_common-WIDTH.
wa_unitsofmeasure-HEIGHT = wa_common-HEIGHT.
wa_unitsofmeasure-UNIT_DIM = wa_common-UNIT_DIM.
APPEND wa_unitsofmeasure TO it_unitsofmeasure.
CLEAR:wa_unitsofmeasure,numtp_t,ean11_t.
ENDIF.

IF NOT wa_common-lzeih4 IS INITIAL.


wa_unitsofmeasure-alt_unit = wa_common-lzeih4.
wa_unitsofmeasure-alt_unit_iso = wa_common-lzeih4.
wa_unitsofmeasure-numerator = wa_common-umrez4.
wa_unitsofmeasure-denominatr = wa_common-umren4.
wa_unitsofmeasure-volume = wa_common-volum * wa_common-umrez4.
wa_unitsofmeasure-volumeunit = wa_common-voleh.
if wa_common-werks_d = '4001' or wa_common-werks_d = '4201'.
wa_unitsofmeasure-gross_wt = wa_common-gross_wt3.
else.
wa_unitsofmeasure-gross_wt = wa_common-brgew * wa_common-umrez4.
endif.
wa_unitsofmeasure-unit_of_wt = wa_common-gewei.
wa_unitsofmeasure-ean_cat = wa_common-numtp_3.
wa_unitsofmeasure-ean_upc = wa_common-ean11_3.
wa_unitsofmeasure-LENGTH = wa_common-LENGTH4.
wa_unitsofmeasure-WIDTH = wa_common-WIDTH4.
wa_unitsofmeasure-HEIGHT = wa_common-HEIGHT4.
wa_unitsofmeasure-UNIT_DIM = wa_common-UNIT_DIM4.
APPEND wa_unitsofmeasure TO it_unitsofmeasure.
CLEAR:wa_unitsofmeasure,numtp_t,ean11_t.
ENDIF.
* UNITSOFMEASUREX
wa_unitsofmeasurex-alt_unit = wa_common-meins.
wa_unitsofmeasurex-alt_unit_iso = wa_common-meins.
wa_unitsofmeasurex-numerator = 'X'.
wa_unitsofmeasurex-denominatr = 'X'.
wa_unitsofmeasurex-volume = 'X'.
wa_unitsofmeasurex-volumeunit = 'X'.
wa_unitsofmeasurex-gross_wt = 'X'.
wa_unitsofmeasurex-LENGTH = 'X'.
wa_unitsofmeasurex-WIDTH = 'X'.
wa_unitsofmeasurex-HEIGHT = 'X'.
wa_unitsofmeasurex-UNIT_DIM = 'X'.
wa_unitsofmeasurex-unit_of_wt = 'X'.
wa_unitsofmeasurex-ean_cat = 'X'.
wa_unitsofmeasurex-ean_upc = 'X'.
APPEND wa_unitsofmeasurex TO it_unitsofmeasurex.
CLEAR : wa_unitsofmeasurex.
IF NOT wa_common-lzeih IS INITIAL.
wa_unitsofmeasurex-alt_unit = wa_common-lzeih.
wa_unitsofmeasurex-alt_unit_iso = wa_common-lzeih.
wa_unitsofmeasurex-numerator = 'X'.
wa_unitsofmeasurex-denominatr = 'X'.
wa_unitsofmeasurex-volume = 'X'.
wa_unitsofmeasurex-volumeunit = 'X'.
wa_unitsofmeasurex-gross_wt = 'X'.
wa_unitsofmeasurex-LENGTH = 'X'.
wa_unitsofmeasurex-WIDTH = 'X'.
wa_unitsofmeasurex-HEIGHT = 'X'.
wa_unitsofmeasurex-UNIT_DIM = 'X'.
wa_unitsofmeasurex-unit_of_wt = 'X'.
wa_unitsofmeasurex-ean_cat = 'X'.
wa_unitsofmeasurex-ean_upc = 'X'.
APPEND wa_unitsofmeasurex TO it_unitsofmeasurex.
CLEAR : wa_unitsofmeasurex.
ENDIF.
IF NOT wa_common-lzeih3 IS INITIAL.
wa_unitsofmeasurex-alt_unit = wa_common-lzeih3.
wa_unitsofmeasurex-alt_unit_iso = wa_common-lzeih3.
wa_unitsofmeasurex-numerator = 'X'.
wa_unitsofmeasurex-denominatr = 'X'.
wa_unitsofmeasurex-volume = 'X'.
wa_unitsofmeasurex-volumeunit = 'X'.
wa_unitsofmeasurex-gross_wt = 'X'.
wa_unitsofmeasurex-LENGTH = 'X'.
wa_unitsofmeasurex-WIDTH = 'X'.
wa_unitsofmeasurex-HEIGHT = 'X'.
wa_unitsofmeasurex-UNIT_DIM = 'X'.
wa_unitsofmeasurex-unit_of_wt = 'X'.
wa_unitsofmeasurex-ean_cat = 'X'.
wa_unitsofmeasurex-ean_upc = 'X'.
APPEND wa_unitsofmeasurex TO it_unitsofmeasurex.
CLEAR : wa_unitsofmeasurex.
ENDIF.
IF NOT wa_common-lzeih4 IS INITIAL.
wa_unitsofmeasurex-alt_unit = wa_common-lzeih4.
wa_unitsofmeasurex-alt_unit_iso = wa_common-lzeih4.
wa_unitsofmeasurex-numerator = 'X'.
wa_unitsofmeasurex-denominatr = 'X'.
wa_unitsofmeasurex-volume = 'X'.
wa_unitsofmeasurex-volumeunit = 'X'.
wa_unitsofmeasurex-gross_wt = 'X'.
wa_unitsofmeasurex-LENGTH = 'X'.
wa_unitsofmeasurex-WIDTH = 'X'.
wa_unitsofmeasurex-HEIGHT = 'X'.
wa_unitsofmeasurex-UNIT_DIM = 'X'.
wa_unitsofmeasurex-unit_of_wt = 'X'.
wa_unitsofmeasurex-ean_cat = 'X'.
wa_unitsofmeasurex-ean_upc = 'X'.
APPEND wa_unitsofmeasurex TO it_unitsofmeasurex.
CLEAR : wa_unitsofmeasurex.
ENDIF.
* UNITSOFMEASURE "Need to maintaing unit of conversion
* IF wa_common-lzeih = 'CV'.
* wa_common-lzeih = 'CS'.
* ENDIF.
* wa_unitsofmeasure-alt_unit = wa_common-lzeih.
* wa_unitsofmeasure-alt_unit_iso = wa_common-lzeih.
* wa_unitsofmeasure-numerator = wa_common-umrez.
* wa_unitsofmeasure-denominatr = wa_common-umren.
* wa_unitsofmeasure-volume = wa_common-volum.
* wa_unitsofmeasure-volumeunit = wa_common-voleh.
* wa_unitsofmeasure-gross_wt = wa_common-brgew.
* wa_unitsofmeasure-unit_of_wt = wa_common-gewei.
* APPEND wa_unitsofmeasure TO it_unitsofmeasure.
* UNITSOFMEASUREX
* wa_unitsofmeasurex-alt_unit = wa_common-lzeih.
* wa_unitsofmeasurex-alt_unit_iso = wa_common-lzeih.
*wa_unitsofmeasurex-NUMERATOR = 'X'.
*wa_unitsofmeasurex-DENOMINATR = 'X'.
*wa_unitsofmeasurex-EAN_UPC = 'X'.
*wa_unitsofmeasurex-EAN_CAT = 'X'.
*wa_unitsofmeasurex-LENGTH = 'X'.
*wa_unitsofmeasurex-WIDTH = 'X'.
*wa_unitsofmeasurex-HEIGHT = 'X'.
*wa_unitsofmeasurex-UNIT_DIM = 'X'.
*wa_unitsofmeasurex-UNIT_DIM_ISO = 'X'.
*wa_unitsofmeasurex-VOLUME = 'X'.
*wa_unitsofmeasurex-VOLUMEUNIT = 'X'.
*wa_unitsofmeasurex-VOLUMEUNIT_ISO = 'X'.
*wa_unitsofmeasurex-GROSS_WT = 'X'.
*wa_unitsofmeasurex-UNIT_OF_WT = 'X'.
*wa_unitsofmeasurex-UNIT_OF_WT_ISO = 'X'.
*wa_unitsofmeasurex-SUB_UOM = 'X'.
*wa_unitsofmeasurex-SUB_UOM_ISO = 'X'.
*wa_unitsofmeasurex-GTIN_VARIANT = 'X'.
*wa_unitsofmeasurex-NESTING_FACTOR = 'X'.
*wa_unitsofmeasurex-MAXIMUM_STACKING = 'X'.
*wa_unitsofmeasurex-CAPACITY_USAGE = 'X'.
*wa_unitsofmeasurex-EWM_CW_UOM_TYPE = 'X'.

* TAXCLASSIFICATIONS

DATA : l_land1 TYPE t001w-land1.


SELECT SINGLE land1 INTO l_land1 FROM t001w WHERE werks EQ wa_common-werks_d
.
IF sy-subrc EQ 0.
IF l_land1 EQ 'IN'.
wa_taxclassifications-depcountry = 'GB'.
wa_taxclassifications-tax_type_1 = 'ZENT'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
wa_taxclassifications-depcountry = 'IN'.
wa_taxclassifications-tax_type_1 = 'JCST'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm2.
APPEND wa_taxclassifications TO it_taxclassifications.
wa_taxclassifications-depcountry = 'IN'.
wa_taxclassifications-tax_type_1 = 'JLST'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm3.
APPEND wa_taxclassifications TO it_taxclassifications.
wa_taxclassifications-depcountry = 'IN'.
wa_taxclassifications-tax_type_1 = 'JCSR'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm4.
APPEND wa_taxclassifications TO it_taxclassifications.
wa_taxclassifications-depcountry = 'IN'.
wa_taxclassifications-tax_type_1 = 'JVT1'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm5.
APPEND wa_taxclassifications TO it_taxclassifications.
wa_taxclassifications-depcountry = 'IN'.
wa_taxclassifications-tax_type_1 = 'JVTR'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm6.
APPEND wa_taxclassifications TO it_taxclassifications.
wa_taxclassifications-depcountry = 'IN'.
wa_taxclassifications-tax_type_1 = 'JLSR'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm7.
APPEND wa_taxclassifications TO it_taxclassifications.
wa_taxclassifications-depcountry = 'IN'.
wa_taxclassifications-tax_type_1 = 'ZVT1'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm8.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'EG'.
wa_taxclassifications-depcountry = 'EG'.
wa_taxclassifications-tax_type_1 = 'ZENT'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'TR' .
wa_taxclassifications-depcountry = 'TR'.
wa_taxclassifications-tax_type_1 = 'ZSCT'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
wa_taxclassifications-depcountry = 'TR'.
wa_taxclassifications-tax_type_1 = 'ZTVT'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm2.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'NP'.
wa_taxclassifications-depcountry = 'NP'.
wa_taxclassifications-tax_type_1 = 'ZNVT'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'GB'.
wa_taxclassifications-depcountry = 'GB'.
wa_taxclassifications-tax_type_1 = 'ZENT'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'AE'.
wa_taxclassifications-depcountry = 'AE'.
wa_taxclassifications-tax_type_1 = 'JTX1'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'PK'.
wa_taxclassifications-depcountry = 'PK'.
wa_taxclassifications-tax_type_1 = 'ZPSP'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'BD'.
wa_taxclassifications-depcountry = 'BD'.
wa_taxclassifications-tax_type_1 = 'ZBVT'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'NG'.
wa_taxclassifications-depcountry = 'NG'.
wa_taxclassifications-tax_type_1 = 'ZENT'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'LK'.
wa_taxclassifications-depcountry = 'LK'.
wa_taxclassifications-tax_type_1 = 'MWST'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
wa_taxclassifications-depcountry = 'LK'.
wa_taxclassifications-tax_type_1 = 'ZLVT'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm2.
APPEND wa_taxclassifications TO it_taxclassifications.
wa_taxclassifications-depcountry = 'LK'.
wa_taxclassifications-tax_type_1 = 'ZNBT'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm3.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'US'.
wa_taxclassifications-depcountry = 'US'.
wa_taxclassifications-tax_type_1 = 'UTXJ'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.
ELSEIF l_land1 = 'ZA'.
wa_taxclassifications-depcountry = 'ZA'.
wa_taxclassifications-tax_type_1 = 'MWST'.
wa_taxclassifications-taxclass_1 = wa_common-taxkm1.
APPEND wa_taxclassifications TO it_taxclassifications.

ENDIF.
ENDIF.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = wa_headdata
clientdata = wa_clientdata
clientdatax = wa_clientdatax
plantdata = wa_plantdata
plantdatax = wa_plantdatax
forecastparameters = wa_forecastparameters
forecastparametersx = wa_forecastparametersx
planningdata = wa_planningdata
planningdatax = wa_planningdatax
storagelocationdata = wa_storagelocationdata
storagelocationdatax = wa_storagelocationdatax
warehousenumberdata = wa_warehousenumberdata
warehousenumberdatax = wa_warehousenumberdatax
valuationdata = wa_valuationdata
valuationdatax = wa_valuationdatax
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
salesdata = wa_salesdata
salesdatax = wa_salesdatax
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
* FLAG_ONLINE = ' '
* FLAG_CAD_CALL = ' '
* NO_DEQUEUE = ' '
* NO_ROLLBACK_WORK = ' '
IMPORTING
return = wa_return
TABLES
materialdescription = it_materialdescription
unitsofmeasure = it_unitsofmeasure
unitsofmeasurex = it_unitsofmeasurex
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
taxclassifications = it_taxclassifications
* RETURNMESSAGES =
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
.
APPEND wa_return TO it_return.
** Test run condition.
DATA: l_bapiret2 TYPE bapiret2.
IF l_test = 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
IMPORTING
return = l_bapiret2.
***
READ TABLE it_return INTO wa_return WITH KEY type = 'S'.
IF sy-subrc EQ 0.
CLEAR : wa_log.
LOOP AT it_return INTO wa_return WHERE type = 'S'.
t_success-type = wa_return-type.
t_success-message = wa_return-message.
APPEND t_success.
wa_log-matnr = wa_common-matnr.
wa_log-werks = wa_common-werks_d.
wa_log-vkorg = wa_common-vkorg.
CONCATENATE wa_log-log1 wa_return-message INTO wa_log-log1 SEPARATED
BY ':'.
CONDENSE wa_log-log1.
CLEAR: wa_ret,t_success.
ENDLOOP.
APPEND wa_log TO it_log.
i = i + 1.
ELSE.
CLEAR message.
CONCATENATE 'Material Creation:' wa_return-message wa_return-message_v1
wa_return-message_v2 wa_return-message_v3 wa_return-message_v4 INTO message SEPA
RATED BY '^'.
t_success-type = 'E'.
CONDENSE message.
t_success-message = message.
APPEND t_success.
wa_log-matnr = wa_common-matnr.
wa_log-werks = wa_common-werks_d.
wa_log-vkorg = wa_common-vkorg.
CONCATENATE wa_return-type message INTO wa_log-log1 SEPARATED BY ':'.
CONDENSE wa_log-log1.
APPEND wa_log TO it_log.
i = i + 1.
ENDIF.
CONTINUE.
ENDIF.
READ TABLE it_return INTO wa_return WITH KEY type = 'S'.
IF sy-subrc EQ 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
DATA: flag(1).
flag = 'X'.
CLEAR : wa_log.
LOOP AT it_return INTO wa_return WHERE type = 'S'.
t_success-type = wa_return-type.
t_success-message = wa_return-message.
APPEND t_success.
wa_log-matnr = wa_common-matnr.
wa_log-werks = wa_common-werks_d.
wa_log-vkorg = wa_common-vkorg.
IF wa_return-message <> ''.
CONCATENATE wa_log-log1 wa_return-message INTO wa_log-log1 SEPARATED
BY ':'.
ENDIF.
CONDENSE wa_log-log1.
CLEAR: wa_ret,t_success.
ENDLOOP.
wa_log-log4 = 'OK'.
APPEND wa_log TO it_log.
i = i + 1.
ELSE.
CLEAR message.
CONCATENATE 'Material Creation:' wa_return-message INTO message SEPARATED
BY ':'.
t_success-type = 'E'.
CONDENSE message.
t_success-message = message.
APPEND t_success.
wa_log-matnr = wa_common-matnr.
wa_log-werks = wa_common-werks_d.
wa_log-vkorg = wa_common-vkorg.
CONCATENATE wa_return-type message INTO wa_log-log1 SEPARATED BY ':'.
CONDENSE wa_log-log1.
wa_log-log4 = 'NOT OK'.
APPEND wa_log TO it_log.
i = i + 1.
ENDIF.

"*************BAPI_MATINSPCTRL_SAVEREPLICA IMPLEMENTATION*******************
**********
DATA: t_tq34 TYPE TABLE OF tq34 WITH HEADER LINE,
it_tq34 LIKE LINE OF t_tq34.
SELECT SINGLE * FROM tq34 INTO it_tq34 WHERE art EQ wa_common-qpart1.
IF sy-subrc EQ 0.
wa_isctrl-material = wa_common-matnr.
wa_isctrl-plant = wa_common-werks_d.
wa_isctrl-insptype = wa_common-qpart1.
wa_isctrl-ave_insp_duration = wa_common-qmpdau.
wa_isctrl-ind_insptype_mat_active = 'X'.
* wa_isctrl-PREFERRED_INSPTYPE = 'X'.
* wa_isctrl-QUAL_SCORE_PROCEDURe = '06'.
wa_isctrl-ind_insp_with_tsk_list = it_tq34-ppl.
wa_isctrl-ind_spec_matspec = it_tq34-spezueber.
wa_isctrl-ind_spec_config = it_tq34-conf.
wa_isctrl-ind_spec_batch = it_tq34-tls.
wa_isctrl-ind_auto_assign = it_tq34-app.
wa_isctrl-ind_insp_by_charac = it_tq34-mer.
wa_isctrl-ind_post_to_insp_stock = it_tq34-insmk.
wa_isctrl-ind_automatic_ud = it_tq34-ave.
wa_isctrl-sampling_procedure = it_tq34-stichprver.
wa_isctrl-dyn_modif_rule = it_tq34-dynregel.
wa_isctrl-insp_percentage = it_tq34-sproz.
wa_isctrl-ind_100_percent_inspection = it_tq34-hpz.
wa_isctrl-ind_skips_allowed = it_tq34-dyn.
wa_isctrl-ind_manual_sample = it_tq34-mpb.
wa_isctrl-ind_manual_sample_calc = it_tq34-mst.
wa_isctrl-ind_single_units_possible = it_tq34-ein.
*wa_isctrl-AVE_INSP_DURATION = it_tq34-MPDAU.
wa_isctrl-contr_insp_lot_create = it_tq34-chg.
wa_isctrl-qual_score_procedure = it_tq34-qkzverf.
wa_isctrl-allowed_scrap_share = it_tq34-qpmat.
wa_isctrl-ind_hu_inspection = it_tq34-afr.
wa_isctrl-ms_flag = it_tq34-ms_flag.
APPEND wa_isctrl TO it_isctrl.
ENDIF.
CLEAR: it_tq34.
SELECT SINGLE * FROM tq34 INTO it_tq34 WHERE art EQ wa_common-qpart2.
IF sy-subrc EQ 0.
wa_isctrl-material = wa_common-matnr.
wa_isctrl-plant = wa_common-werks_d.
wa_isctrl-insptype = wa_common-qpart2.
wa_isctrl-ave_insp_duration = wa_common-qmpdau.
* wa_isctrl-QUAL_SCORE_PROCEDURe = '06'.
wa_isctrl-ind_insptype_mat_active = 'X'.
* wa_isctrl-PREFERRED_INSPTYPE = 'X'.
wa_isctrl-ind_insp_with_tsk_list = it_tq34-ppl.
wa_isctrl-ind_spec_matspec = it_tq34-spezueber.
wa_isctrl-ind_spec_config = it_tq34-conf.
wa_isctrl-ind_spec_batch = it_tq34-tls.
wa_isctrl-ind_auto_assign = it_tq34-app.
wa_isctrl-ind_insp_by_charac = it_tq34-mer.
wa_isctrl-ind_post_to_insp_stock = it_tq34-insmk.
wa_isctrl-ind_automatic_ud = it_tq34-ave.
wa_isctrl-sampling_procedure = it_tq34-stichprver.
wa_isctrl-dyn_modif_rule = it_tq34-dynregel.
wa_isctrl-insp_percentage = it_tq34-sproz.
wa_isctrl-ind_100_percent_inspection = it_tq34-hpz.
wa_isctrl-ind_skips_allowed = it_tq34-dyn.
wa_isctrl-ind_manual_sample = it_tq34-mpb.
wa_isctrl-ind_manual_sample_calc = it_tq34-mst.
wa_isctrl-ind_single_units_possible = it_tq34-ein.
*wa_isctrl-AVE_INSP_DURATION = it_tq34-MPDAU.
wa_isctrl-contr_insp_lot_create = it_tq34-chg.
wa_isctrl-qual_score_procedure = it_tq34-qkzverf.
wa_isctrl-allowed_scrap_share = it_tq34-qpmat.
wa_isctrl-ind_hu_inspection = it_tq34-afr.
wa_isctrl-ms_flag = it_tq34-ms_flag.
APPEND wa_isctrl TO it_isctrl.
ENDIF.
CLEAR: it_tq34.
SELECT SINGLE * FROM tq34 INTO it_tq34 WHERE art EQ wa_common-qpart3.
IF sy-subrc EQ 0.
wa_isctrl-material = wa_common-matnr.
wa_isctrl-plant = wa_common-werks_d.
wa_isctrl-insptype = wa_common-qpart3.
wa_isctrl-ave_insp_duration = wa_common-qmpdau.
* wa_isctrl-QUAL_SCORE_PROCEDURe = '06'.
wa_isctrl-ind_insptype_mat_active = 'X'.
* wa_isctrl-PREFERRED_INSPTYPE = 'X'.
wa_isctrl-ind_insp_with_tsk_list = it_tq34-ppl.
wa_isctrl-ind_spec_matspec = it_tq34-spezueber.
wa_isctrl-ind_spec_config = it_tq34-conf.
wa_isctrl-ind_spec_batch = it_tq34-tls.
wa_isctrl-ind_auto_assign = it_tq34-app.
wa_isctrl-ind_insp_by_charac = it_tq34-mer.
wa_isctrl-ind_post_to_insp_stock = it_tq34-insmk.
wa_isctrl-ind_automatic_ud = it_tq34-ave.
wa_isctrl-sampling_procedure = it_tq34-stichprver.
wa_isctrl-dyn_modif_rule = it_tq34-dynregel.
wa_isctrl-insp_percentage = it_tq34-sproz.
wa_isctrl-ind_100_percent_inspection = it_tq34-hpz.
wa_isctrl-ind_skips_allowed = it_tq34-dyn.
wa_isctrl-ind_manual_sample = it_tq34-mpb.
wa_isctrl-ind_manual_sample_calc = it_tq34-mst.
wa_isctrl-ind_single_units_possible = it_tq34-ein.
*wa_isctrl-AVE_INSP_DURATION = it_tq34-MPDAU.
wa_isctrl-contr_insp_lot_create = it_tq34-chg.
wa_isctrl-qual_score_procedure = it_tq34-qkzverf.
wa_isctrl-allowed_scrap_share = it_tq34-qpmat.
wa_isctrl-ind_hu_inspection = it_tq34-afr.
wa_isctrl-ms_flag = it_tq34-ms_flag.
APPEND wa_isctrl TO it_isctrl.
ENDIF.
CLEAR: it_tq34.
SELECT SINGLE * FROM tq34 INTO it_tq34 WHERE art EQ wa_common-qpart4.
IF sy-subrc EQ 0.
wa_isctrl-material = wa_common-matnr.
wa_isctrl-plant = wa_common-werks_d.
wa_isctrl-insptype = wa_common-qpart4.
wa_isctrl-ave_insp_duration = wa_common-qmpdau.
* wa_isctrl-QUAL_SCORE_PROCEDURe = '06'.
wa_isctrl-ind_insptype_mat_active = 'X'.
* wa_isctrl-PREFERRED_INSPTYPE = 'X'.
wa_isctrl-ind_insp_with_tsk_list = it_tq34-ppl.
wa_isctrl-ind_spec_matspec = it_tq34-spezueber.
wa_isctrl-ind_spec_config = it_tq34-conf.
wa_isctrl-ind_spec_batch = it_tq34-tls.
wa_isctrl-ind_auto_assign = it_tq34-app.
wa_isctrl-ind_insp_by_charac = it_tq34-mer.
wa_isctrl-ind_post_to_insp_stock = it_tq34-insmk.
wa_isctrl-ind_automatic_ud = it_tq34-ave.
wa_isctrl-sampling_procedure = it_tq34-stichprver.
wa_isctrl-dyn_modif_rule = it_tq34-dynregel.
wa_isctrl-insp_percentage = it_tq34-sproz.
wa_isctrl-ind_100_percent_inspection = it_tq34-hpz.
wa_isctrl-ind_skips_allowed = it_tq34-dyn.
wa_isctrl-ind_manual_sample = it_tq34-mpb.
wa_isctrl-ind_manual_sample_calc = it_tq34-mst.
wa_isctrl-ind_single_units_possible = it_tq34-ein.
*wa_isctrl-AVE_INSP_DURATION = it_tq34-MPDAU.
wa_isctrl-contr_insp_lot_create = it_tq34-chg.
wa_isctrl-qual_score_procedure = it_tq34-qkzverf.
wa_isctrl-allowed_scrap_share = it_tq34-qpmat.
wa_isctrl-ind_hu_inspection = it_tq34-afr.
wa_isctrl-ms_flag = it_tq34-ms_flag.
APPEND wa_isctrl TO it_isctrl.
ENDIF.
CLEAR: it_tq34.
SELECT SINGLE * FROM tq34 INTO it_tq34 WHERE art EQ wa_common-qpart5.
IF sy-subrc EQ 0.
wa_isctrl-material = wa_common-matnr.
wa_isctrl-plant = wa_common-werks_d.
wa_isctrl-insptype = wa_common-qpart5.
wa_isctrl-ave_insp_duration = wa_common-qmpdau.
* wa_isctrl-QUAL_SCORE_PROCEDURe = '06'.
wa_isctrl-ind_insptype_mat_active = 'X'.
* wa_isctrl-PREFERRED_INSPTYPE = 'X'.
wa_isctrl-ind_insp_with_tsk_list = it_tq34-ppl.
wa_isctrl-ind_spec_matspec = it_tq34-spezueber.
**wa_isctrl-IND_SPEC_CONFIG = it_tq34-CONF.
**wa_isctrl-IND_SPEC_BATCH = it_tq34-TLS.
wa_isctrl-ind_auto_assign = it_tq34-app.
wa_isctrl-ind_insp_by_charac = it_tq34-mer.
wa_isctrl-ind_post_to_insp_stock = it_tq34-insmk.
wa_isctrl-ind_automatic_ud = it_tq34-ave.
wa_isctrl-sampling_procedure = it_tq34-stichprver.
wa_isctrl-dyn_modif_rule = it_tq34-dynregel.
wa_isctrl-insp_percentage = it_tq34-sproz.
wa_isctrl-ind_100_percent_inspection = it_tq34-hpz.
wa_isctrl-ind_skips_allowed = it_tq34-dyn.
wa_isctrl-ind_manual_sample = it_tq34-mpb.
wa_isctrl-ind_manual_sample_calc = it_tq34-mst.
wa_isctrl-ind_single_units_possible = it_tq34-ein.
*wa_isctrl-AVE_INSP_DURATION = it_tq34-MPDAU.
wa_isctrl-contr_insp_lot_create = it_tq34-chg.
wa_isctrl-qual_score_procedure = it_tq34-qkzverf.
wa_isctrl-allowed_scrap_share = it_tq34-qpmat.
wa_isctrl-ind_hu_inspection = it_tq34-afr.
wa_isctrl-ms_flag = it_tq34-ms_flag.
APPEND wa_isctrl TO it_isctrl.
ENDIF.
IF flag = 'X' .
IF wa_common-qpart1 NE ''.
CALL FUNCTION 'BAPI_MATINSPCTRL_SAVEREPLICA'
TABLES
return = it_ret
inspectionctrl = it_isctrl.
* READ TABLE it_ret INTO wa_ret WITH KEY type = 'S'.
* IF sy-subrc EQ 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
CLEAR wa_log.
IF it_ret IS INITIAL.
t_success-type = 'S'.
t_success-message = 'Inspection setup created Successfully'.
APPEND t_success.
CONCATENATE 'S' 'Inspection setup created Successfully' INTO wa_log-lo
g2 SEPARATED BY ':'.
MODIFY it_log FROM wa_log INDEX i TRANSPORTING log2.
ELSE.
* LOOP AT IT_RET INTO WA_RET.
* T_SUCCESS-TYPE = WA_RET-TYPE.
* T_SUCCESS-MESSAGE = WA_RET-MESSAGE.
* APPEND T_SUCCESS.
* CONCATENATE WA_RET-TYPE WA_RET-MESSAGE INTO WA_LOG-LOG2 SEPARATED BY
'^'.
* CONDENSE WA_LOG-LOG2.
* MODIFY IT_LOG FROM WA_LOG WHERE MATNR = wa_common-matnr TRANSPORTING LO
G2.
* CLEAR: WA_RET,T_SUCCESS.
* ENDLOOP.
** ENDIF.
CLEAR : wa_log.
READ TABLE it_ret INTO wa_ret WITH KEY type = 'E'.
IF sy-subrc EQ 0.
LOOP AT it_ret INTO wa_ret.
t_error-type = wa_ret-type.
t_error-message = wa_ret-message.
IF wa_ret-message <> ''.
CONCATENATE wa_log-log2 wa_ret-message INTO wa_log-log2 SEPARATE
D BY ':'.
APPEND t_error.
ENDIF.
CLEAR: wa_ret,t_error.
ENDLOOP.
CONCATENATE 'E' wa_log-log2 INTO wa_log-log2 SEPARATED BY '^'.
MODIFY it_log FROM wa_log INDEX i TRANSPORTING log2.
ENDIF.
ENDIF.
ENDIF.
IF NOT wa_common-j_1ichid IS INITIAL.
PERFORM bdc_dynpro USING 'SAPMJ1ID' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RB1'.
PERFORM bdc_field USING 'BDC_OKCODE' '=EX'.
PERFORM bdc_field USING 'RB11' ''.
PERFORM bdc_field USING 'RB1' 'X'.
PERFORM bdc_dynpro USING 'SAPLJ1I5' '0020'.
PERFORM bdc_field USING 'BDC_CURSOR' 'J_1IMTCHID-J_1ICHID(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=NEWL'.
PERFORM bdc_dynpro USING 'SAPLJ1I5' '0020'.
PERFORM bdc_field USING 'BDC_CURSOR' 'J_1IMTCHID-J_1ICHID(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'J_1IMTCHID-MATNR(01)' wa_common-matnr.
PERFORM bdc_field USING 'J_1IMTCHID-WERKS(01)' wa_common-werks_d.
PERFORM bdc_field USING 'J_1IMTCHID-J_1ICHID(01)' wa_common-j_1ich
id.
PERFORM bdc_field USING 'J_1IMTCHID-J_1ICAPIND(01)' wa_common-j_1i
capind.
PERFORM bdc_dynpro USING 'SAPLJ1I5' '0020'.
PERFORM bdc_field USING 'BDC_CURSOR' 'J_1IMTCHID-MATNR(02)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SAVE'.
PERFORM bdc_dynpro USING 'SAPLJ1I5' '0020'.
PERFORM bdc_field USING 'BDC_CURSOR' 'J_1IMTCHID-MATNR(02)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BACK'.
PERFORM bdc_dynpro USING 'SAPLJ1I5' '0020'.
PERFORM bdc_field USING 'BDC_CURSOR' 'J_1IMTCHID-MATNR(02)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BACK'.
PERFORM bdc_dynpro USING 'SAPMJ1ID' '0200'.
PERFORM bdc_field USING 'BDC_OKCODE' '/EEXIT'.
PERFORM bdc_field USING 'BDC_CURSOR' 'EXCISE'.
*perform bdc_transaction using 'J1ID'.
CALL TRANSACTION 'J1ID' USING ibdc
MODE l_mode
UPDATE 'A'
MESSAGES INTO messtab.
CLEAR: ibdc,ibdc[].
CLEAR wa_log.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.

clear: v_steuc.
READ TABLE messtab WITH KEY msgtyp = 'S'.
* msgnr = '312'.
IF sy-subrc = 0.
SELECT SINGLE steuc FROM marc INTO v_steuc WHERE matnr = wa_common-ma
tnr AND werks = wa_common-werks_d.
IF sy-subrc = 0 and v_steuc NE ''.
t_success_j1id-matnr = messtab-msgv1.
t_success_j1id-werks = messtab-msgv2.
APPEND t_success_j1id.
CONCATENATE 'J1ID' 'SUCCESS' INTO wa_log-log3 SEPARATED BY ':'.
CONDENSE wa_log-log3.
MODIFY it_log FROM wa_log INDEX i TRANSPORTING log3.
ELSE.
CONCATENATE 'J1ID' 'FAILURE' INTO wa_log-log3 SEPARATED BY ':'.
MODIFY it_log FROM wa_log INDEX i TRANSPORTING log3.
ENDIF.
ELSE.
CLEAR wa_log.
wa_log-log3 = ''.
* LOOP AT messtab WHERE msgtyp = 'E'.
* SELECT SINGLE * FROM t100 WHERE sprsl = messtab-msgspra
* AND arbgb = messtab-msgid
* AND msgnr = messtab-msgnr.
* IF sy-subrc = 0.
* lm_string = t100-text.
* IF lm_string CS '&1'.
* REPLACE '&1' WITH messtab-msgv1 INTO lm_string.
* REPLACE '&2' WITH messtab-msgv2 INTO lm_string.
* REPLACE '&3' WITH messtab-msgv3 INTO lm_string.
* REPLACE '&4' WITH messtab-msgv4 INTO lm_string.
* ELSEIF lm_string CS '$'.
* REPLACE '$' WITH messtab-msgv1 INTO lm_string.
* REPLACE '$' WITH messtab-msgv2 INTO lm_string.
* REPLACE '$' WITH messtab-msgv3 INTO lm_string.
* REPLACE '$' WITH messtab-msgv4 INTO lm_string.
* ELSE.
* REPLACE '&' WITH messtab-msgv1 INTO lm_string.
* REPLACE '&' WITH messtab-msgv2 INTO lm_string.
* REPLACE '&' WITH messtab-msgv3 INTO lm_string.
* REPLACE '&' WITH messtab-msgv4 INTO lm_string.
* ENDIF.
* CONDENSE lm_string.
* t_error_j1id-error_txt = lm_string.
* APPEND t_error_j1id.
* CONCATENATE wa_log-log3 lm_string INTO wa_log-log3 SEPARATED BY '^'
.
* CONDENSE wa_log-log3.
* ENDIF.
* ENDLOOP.
* CONCATENATE 'J1ID' wa_log-log3 INTO wa_log-log3 SEPARATED BY '^'.
MODIFY it_log FROM wa_log INDEX i TRANSPORTING log3.
ENDIF.
ENDIF.
"*************BAPI BAPI_OBJCL_CREATE IMPLEMENTATION******************
wa_objectkeynew = wa_common-matnr.
wa_objecttablenew = 'MARA'.
wa_classnumnew = 'FMCG_BATCHCLASS'.
wa_classtypenew = wa_common-klassenart.
*wa_STATUS = '1'.
*wa_STANDARDCLASS
*wa_CHANGENUMBER
*wa_KEYDATE = SY-DATUM.
*wa_NO_DEFAULT_VALUES
wa_allocvalueschar-charact = 'LOBM_HSDAT'.
wa_allocvalueschar-value_char = '< 31.12.9999'.
wa_allocvalueschar-charact_descr = 'Date when Batch Was Produced'.
APPEND wa_allocvalueschar TO it_allocvalueschar.
wa_allocvalueschar-charact = 'LOBM_VFDAT'.
wa_allocvalueschar-value_char = '< 31.12.9999'.
wa_allocvalueschar-charact_descr = 'Expiration date, shelf life'.
APPEND wa_allocvalueschar TO it_allocvalueschar.

CALL FUNCTION 'BAPI_OBJCL_CREATE'


EXPORTING
objectkeynew = wa_objectkeynew
objecttablenew = wa_objecttablenew
classnumnew = wa_classnumnew
classtypenew = wa_classtypenew
status = '1'
* STANDARDCLASS =
* CHANGENUMBER =
keydate = sy-datum
* NO_DEFAULT_VALUES = ' '
* IMPORTING
* CLASSIF_STATUS =
TABLES
* ALLOCVALUESNUM =
allocvalueschar = it_allocvalueschar
* ALLOCVALUESCURR =
return = it_ret2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
CLEAR wa_log.
READ TABLE it_ret2 INTO wa_ret2 WITH KEY type = 'S'.
IF sy-subrc EQ 0.
LOOP AT it_ret2 INTO wa_ret2.
t_success_bapi_objcl_create-type = wa_ret2-type.
t_success_bapi_objcl_create-message = wa_ret2-message.
APPEND t_success_bapi_objcl_create.
IF sy-tabix = 1.
* wa_log-log4 = wa_ret2-message.
ENDIF.
* CONCATENATE wa_log-log4 wa_ret2-message INTO wa_log-log4 SEPARATED BY
'^'.
* CONDENSE wa_log-log4.
CLEAR: wa_ret2,t_success_bapi_objcl_create.
ENDLOOP.
* CONCATENATE 'S' wa_log-log4 INTO wa_log-log4 SEPARATED BY '^'.
* CONDENSE wa_log-log4.
* MODIFY it_log FROM wa_log INDEX i TRANSPORTING log4.
ELSE.
READ TABLE it_ret2 INTO wa_ret2 WITH KEY type = 'E'.
IF sy-subrc EQ 0.
LOOP AT it_ret2 INTO wa_ret2.
t_error_bapi_objcl_create-type = wa_ret2-type.
t_error_bapi_objcl_create-message = wa_ret2-message.
APPEND t_error_bapi_objcl_create.
IF sy-tabix = 1.
* wa_log-log4 = wa_ret2-message.
ENDIF.
* CONCATENATE wa_log-log4 wa_ret2-message INTO wa_log-log4 SEPARATED
BY '^'.
* CONDENSE wa_log-log4.
CLEAR: wa_ret2,t_error_bapi_objcl_create.
ENDLOOP.
* CONCATENATE 'E' wa_log-log4 INTO wa_log-log4 SEPARATED BY '^'.
* CONDENSE wa_log-log4.
* MODIFY it_log FROM wa_log INDEX i TRANSPORTING log4.
ENDIF.
ENDIF.
DATA: fname TYPE thead-tdname.
CONCATENATE wa_common-matnr wa_common-vkorg wa_common-vtweg INTO fname RES
PECTING BLANKS.
DATA: tline TYPE STANDARD TABLE OF tline WITH HEADER LINE.
tline-tdformat = '*'.
IF NOT wa_common-sale_text IS INITIAL.
tline-tdline = wa_common-sale_text.
APPEND tline.
ENDIF.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = '0001'
flanguage = 'E'
fname = fname
fobject = 'MVKE'
save_direct = 'X'
fformat = '*'
TABLES
flines = tline
* EXCEPTIONS
* NO_INIT = 1
* NO_SAVE = 2
* OTHERS = 3
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
CLEAR:tline,tline[].
tline-tdformat = '*'.
IF NOT wa_common-sale_text2 IS INITIAL.
tline-tdline = wa_common-sale_text2.
APPEND tline.
ENDIF.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = '0001'
flanguage = 'T'
fname = fname
fobject = 'MVKE'
save_direct = 'X'
fformat = '*'
TABLES
flines = tline
* EXCEPTIONS
* NO_INIT = 1
* NO_SAVE = 2
* OTHERS = 3
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
CLEAR:tline,tline[].
ELSE.
CLEAR wa_log.
wa_log-log2 = 'DECLINE'.
wa_log-log3 = 'DECLINE'.
* wa_log-log4 = 'DECLINE'.
MODIFY it_log FROM wa_log INDEX i TRANSPORTING log2 log3." log4.
CLEAR wa_log.
ENDIF.
CLEAR : wa_log.
ENDLOOP.
ENDFORM. " UPLOAD
*&---------------------------------------------------------------------*
*& Form DISPLAYLOG2
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM displaylog2 .
IF t_error[] IS NOT INITIAL.
WRITE:/5 ' BAPI BAPI_MATINSPCTRL_SAVEREPLICA *E R R O R L I S T* '.
WRITE:/5 '---------------------'.
SKIP.
WRITE:/5 'Type',
25 'Message'.
SKIP.
LOOP AT t_error.
WRITE:/5 'ERROR' COLOR 6 INTENSIFIED OFF ,
25 t_error-message.
ENDLOOP.
ENDIF.
IF t_success[] IS NOT INITIAL.
SKIP.
WRITE:/5 'BAPI BAPI_MATINSPCTRL_SAVEREPLICA *S U C C E S S L I S T* '.
WRITE:/5 '--------------------------'.
SKIP.
WRITE:/5 'Type',
25 'Message'.
SKIP.
LOOP AT t_success.
WRITE:/5 'SUCCESS' COLOR 5 INTENSIFIED OFF,
25 t_success-message.
ENDLOOP.
ENDIF.
IF t_error_j1id[] IS NOT INITIAL.
WRITE:/5 ' BDC J1ID *E R R O R L I S T* '.
WRITE:/5 '---------------------'.
SKIP.
WRITE:/5 'Message'.
SKIP.
LOOP AT t_error_j1id.
WRITE:/5 'ERROR' COLOR 6 INTENSIFIED OFF ,
25 t_error_j1id-error_txt.
ENDLOOP.
ENDIF.
IF t_success_j1id[] IS NOT INITIAL.
WRITE:/5 ' BDC J1ID *Success L I S T* '.
WRITE:/5 '---------------------'.
SKIP.
WRITE:/5 'Message'.
SKIP.
LOOP AT t_success_j1id.
WRITE:/5 'SUCCESS' COLOR 6 INTENSIFIED OFF ,
25 t_success_j1id-matnr,t_success_j1id-werks.
ENDLOOP.
ENDIF.
IF t_error_bapi_objcl_create[] IS NOT INITIAL.
WRITE:/5 ' BAPI BAPI_OBJCL_CREATE *E R R O R L I S T* '.
WRITE:/5 '---------------------'.
SKIP.
WRITE:/5 'Type',
25 'Message'.
SKIP.
LOOP AT t_error_bapi_objcl_create.
WRITE:/5 'ERROR' COLOR 6 INTENSIFIED OFF ,
25 t_error_bapi_objcl_create-message.
ENDLOOP.
ENDIF.
IF t_success_bapi_objcl_create[] IS NOT INITIAL.
SKIP.
WRITE:/5 'BAPI BAPI_OBJCL_CREATE *S U C C E S S L I S T* '.
WRITE:/5 '--------------------------'.
SKIP.
WRITE:/5 'Type',
25 'Message'.
SKIP.
LOOP AT t_success.
WRITE:/5 'SUCCESS' COLOR 5 INTENSIFIED OFF,
25 t_success_bapi_objcl_create-message.
ENDLOOP.
ENDIF.

ENDFORM. " DISPLAYLOG2


*&---------------------------------------------------------------------*
*& Form BDC_DYNPRO
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_2594 text
* -->P_2595 text
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR ibdc.
ibdc-program = program.
ibdc-dynpro = dynpro.
ibdc-dynbegin = 'X'.
APPEND ibdc.
ENDFORM. " BDC_DYNPRO
*&---------------------------------------------------------------------*
*& Form BDC_FIELD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_2599 text
* -->P_2600 text
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
CLEAR ibdc.
ibdc-fnam = fnam.
ibdc-fval = fval.
APPEND ibdc.
ENDFORM. " BDC_FIELD
*&---------------------------------------------------------------------*
*& Form DOWNLOAD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM download .
DATA file TYPE rlgrap-filename.
IF l_test IS INITIAL.
CONCATENATE 'D:\material_mas\' 'LOG_' sy-datum sy-uzeit '.xlsx' INTO file.
ELSEIF l_test = 'X'.
CONCATENATE 'D:\material_test\' 'TestRun_LOG_' sy-datum sy-uzeit '.xlsx' INT
O file.
ENDIF.
CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
i_field_seperator = 'X'
* I_LINE_HEADER =
i_filename = file
* I_APPL_KEEP = ' '
TABLES
i_tab_sap_data = it_log.
* CHANGING
* I_TAB_CONVERTED_DATA =
* EXCEPTIONS
* CONVERSION_FAILED = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
* CALL FUNCTION 'GUI_DOWNLOAD'
* EXPORTING
* FILENAME = FILE
* FILETYPE = 'ASC'
* APPEND = 'X'
* WRITE_FIELD_SEPARATOR = 'X'
* TABLES
* DATA_TAB = IT_LOG.
IF sy-subrc = 0.
MESSAGE 'LOG FIle Downloaded to D:\' TYPE 'S'.
ELSE.
MESSAGE 'Failed to Download' TYPE 'S'.
ENDIF.
ENDFORM. " DOWNLOAD

You might also like