Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Coding from Specification

Former Member
0 Kudos

Hi All,

I have a clarification regarding following Technical specification.

Can anybody tell me what is the exact coding i can do for following specification.

Here I_EKKO is for Header data, XEKPO is for line item data etc.

Activate user exit MM06E005 (EXIT_SAPMM06E_013) to accomplish this.

1. For I_EKKO-RESWK <> “ “ and XEKPO-TECHS = “ “ and MARA-KZEFF = X (for MARA-MATNR = XEKPO-MATNR) and XEKPO-LOEKZ = “ “ and XEKPO-ELIKZ = “ “, get XEKPO-EBELN, XEKPO-EBELP, XEKPO-MATNR, XEKPO-WERKS, XEKET-EINDT, XEKKN-PS_PSP_PNR (existing logic) – please note that we used RESWK from EKKO and now we are using WERKS from EKPO.

2. For XEKPO-PSTYP = 3 and XEKPO-TECHS = “ “ and MARA-KZEFF = X (for MARA-MATNR = XEKPO-MATNR) and XEKPO-LOEKZ = “ “ and XEKPO-ELIKZ = “ “, get XEKPO-EBELN, XEKPO-EBELP, XEKPO-MATNR, XEKKO-WERKS, XEKET-EINDT, XEKKN-PS_PSP_PNR. 

3. For records retrieved for step 1 and 2, get part type for unique MATNR and WERKS combination: Pass XEKPO-MATNR and XEKPO-WERKS as I_MATNR and I_WERKS to function module Z50_MFGTYPE and get E_PTYPE – please note that we used RESWK from EKKO and now we are using WERKS from EKPO.

4. Write all these fields to table zppe0169_01.

Can anybody solve my issue.

Thanks in advance.

Thanks & Regards,

Rayeez.

2 REPLIES 2

Former Member
0 Kudos

Hi shaik

Loop at I_ekko where RESWK <> “ “.

loop at xekpo where ebeln eq i_ekpo-ebeln and TECHS = “ “ and LOEKZ = “ “ and ELIKZ = “ “ and KZEFF = X.

append xekpo1.

endloop.

loop at xekpo where ebeln eq i_ekpo-ebeln and PSTYP = 3 and TECHS = “ “ and LOEKZ = “ “ and KZEFF = X.

append xekpo2.

endloop.

regards

kishore

endloop.

Former Member
0 Kudos

Hello Shaik,

try using this...

data: 1_ebeln like ekpo-ebeln,

1_ebelp like ekpo-ebelp,

1_matnr like ekpo-matnr,

1_werks like ekpo-werks,

1_eindt like eket-eindt,

1_PS_PSP_PNR like ekkn-PS_PSP_PNR.

data: 2_ebeln like ekpo-ebeln,

2_ebelp like ekpo-ebelp,

2_matnr like ekpo-matnr,

2_werks like ekpo-werks,

2_eindt like eket-eindt,

2_PS_PSP_PNR like ekkn-PS_PSP_PNR.

data: t_kzeff like mara-kzeff.

clear: 1_ebeln,

1_ebelp,

1_matnr,

1_werks,

1_eindt,

1_PS_PSP_PNR.

clear: 2_ebeln,

2_ebelp,

2_matnr,

2_werks,

2_eindt,

2_PS_PSP_PNR.

if i_ekko-RESWK <> ' '.

loop at xekpo where TECHS = ' ' and

LOEKZ = ' ' and

ELIKZ = ' '.

        • Populate step 1.

  • get the kzeff from MARA by accessing the table as MARA is not

  • available in the exit.

select single kzeff into t_kzeff from mara

where matnr = xekpo-matnr.

  • if record found

if sy-subrc = 0.

check t_kzeff = 'X'.

1_ebeln = i_ekko-ebeln.

1_ebelp = xekpo-ebelp.

1_matnr = xekpo-matnr.

1_werks = xekpo-werks.

  • Reading first record. If there are multiple schedule line then u need

  • have logic for which one to read.

read table xeket index 1.

if sy-subrc = 0.

1_eindt = xeket-eindt.

else.

clear 1_eindt.

endif.

  • Reading first record. If there are multiple lines then u need

  • have logic for which one to read.

read table xekkn index 1.

if sy-subrc = 0.

1_PS_PSP_PNR = xekkn-PS_PSP_PNR.

else.

clear 1_PS_PSP_PNR.

endif.

        • Populate step 2.

if XEKPO-PSTYP = 3.

2_ebeln = i_ekko-ebeln.

2_ebelp = xekpo-ebelp.

2_matnr = xekpo-matnr.

2_werks = xekpo-werks.

  • Reading first record. If there are multiple schedule line then u need

  • have logic for which one to read.

read table xeket index 1.

if sy-subrc = 0.

2_eindt = xeket-eindt.

else.

clear 2_eindt.

endif.

  • Reading first record. If there are multiple lines then u need

  • have logic for which one to read.

read table xekkn index 1.

if sy-subrc = 0.

2_PS_PSP_PNR = xekkn-PS_PSP_PNR.

else.

clear 2_PS_PSP_PNR.

endif.

endif.

endif.

  • now u can get matnr and werks and pass it to ur FM Z50_MSGTYPE and

  • get E_PTYPE....

  • Now u can write all the fields into an internal table and update the

  • table later zppe0169_01 later.The structure for internal table similar

  • the zppe0169_01.

endloop.

  • update the customer table from internal table

endif.