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: 

Function module import parameter....Urgent

Former Member
0 Kudos

Hi Experts,

I am using User Exit M06E0004 which is using <b>FM EXIT_SAPLEBND_002</b>. It has 4 inport parameters

I_CEKKO LIKE CEKKO

IT_BEKPO TYPE MMPUR_BEKPO

IT_BEKET TYPE MMPUR_BEKET

IT_EKKNU TYPE MMPUR_EKKNU

and 1 export paramenter E_CEKKO LIKE CEKKO

I want to pass 1 more field MDSB-matnr(character type matnr for BOM child Items) which is not in any the structure here.

Its a standard FM so we have 1 include for enhancement in this exit. So what to do to get values for this. i need this matnr against a PO in CEKKO.

I need to do all this for my requirement of IDOC. I have to send IDOC when any subcontract PO release and having Child Items(BOM materials MDSB-matnr) started with 'P'.

Regards,

Nik

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can get the value of the field MDSB-matnr using field symbols if the variable MDSB-matnr is available in the main program.

14 REPLIES 14

Former Member
0 Kudos

You can get the value of the field MDSB-matnr using field symbols if the variable MDSB-matnr is available in the main program.

0 Kudos

I dont have any main program,

I am using an Exit, in which EXIT_SAPLEBND_002 is an FM with 4 given import parameter with 1 export parameter, in which no one has the values for MDSB-matnr.

I can only rite code in the include given inside the FM source code.

What will be the code i have to rite to get thsese values

TABLE Field name

EKKO EBELN

EKKO LIFNR

EKKO EKORG

EKKO BEDAT

EKPO WERKS

EKPO EBELP

EKPO MATNR

EKPO MENGE

EKPO REVLV

MDSB MATNR

EKET EINDT

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can certainly add MATNR as a new field to CEKKO... you have to add it to structure CEKKOZZ which is there for customer modifications. However you will have to fill this MATNR somehow in the exit. The MSDB-MATNR is actually RESB-MATNR, so depending on what you want to achieve, you'd have to read RESB somehow.

0 Kudos

CEKKOZZ is not for custom modification, it is asking for the acces key.

And I think i can read MDSB-matnr in the source code of FM.

Tell me few more things, when i will release the PO after creating it, does all these tables in the Import parameter of EXIT FM will get filled automatically ?

Can i select values from import parameter tables too ? Like if i have to pass PO number, Item etc can i select it from there these fields are not in the CEKKO structure ?

Regards

Nik

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

>>>

<i>CEKKOZZ is not for custom modification, it is asking for the acces key.</i>

<<<

Well... the description of that structure says "Communication Structure: PO release for User Exit".

Believe me, the purpose of CEKKOZZ is exactly to define any additional fields necessary in the enhancement for the PO release strategy. Yes, it is asking for the access key, but this is similar to modifying an "old style" user exit, for instance in SAPMV45A. That will also ask for an access key, but it's still not considered to be a core modification.

>>>

<i>Tell me few more things, when i will release the PO after creating it, does all these tables in the Import parameter of EXIT FM will get filled automatically ?

Can i select values from import parameter tables too ?</i>

<<<

Yes, those tables will be populated. You can use those values for any selection you need.

0 Kudos

Is ther any other ways to add the field because client is not ready to give the Access key.

I am trying to create a new FM and importing same import variables if anyhow i can add that table in this FM it will be good then i can read matnr in this FM itself.

I trying picking values in my new FM for ekpo, eket but is says it_bekpo and it_beket is not a structure or a table. its a table type,

i dont no how to take values now because i have to take 11 values from these tables and i only fot 4 in CEKKO rest 6 i have to take from it_bekpo and it_beket and one id from MDSB-MATNR

Regards

Nik

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

I'm not sure I understand what do you want to achieve here.

The enhancement in question is to influence the release strategy determination for the PO. Is this what you want to do? Do you need the material number field because the release strategy determination will use that? This would be the only reason to add the MATNR field to CEKKO.

Also, are you asking how to read the rows in IT_BEKPO, IT_BEKET and so on? Since those are internal tables, use a LOOP into a workarea that you define as the line type for those tables...

And I don't really know how/why do you want to read the view MDSB.

I guess what I'm trying to say is that in order to help you, one has to understand what your goal is.

0 Kudos

the requirement is,

I have to send a customized IDOC to external application when a PO release. For sending IDOC automaticaly when PO release, I fount User exit M06E0004.

If u will open that u will find a FM in which import & export parameters are as given above.

And IT_BEKPO, IT_BEKET are not internal tables , they are import parameters of table type MMPUR_BEKPO and MMPUR_BEKET.

Beacuse of table type we cant write it like it_bekpo-ebelp etc means we cant pass values in these variables to my internal table.

Regards,

Nik

0 Kudos

I am using FM EXIT_SAPLEBND_002. it is having 4 import parameters and 1 export parameter.

<u>IMPORT</u>

I_CEKKO LIKE CEKKO its a structure

IT_BEKPO TYPE MMPUR_BEKPO its a table type not table

IT_BEKET TYPE MMPUR_BEKET its a table type not table

IT_EKKNU TYPE MMPUR_EKKNU its a table type not table

<u>EXPORT</u>

E_CEKKO LIKE CEKKO structure

I need these 11 fields as an output to pass it to IDOC creation FM as a structure which i already created.

TABLE Field name Data Type

EKKO EBELN EBELN

EKKO LIFNR ELIFN

EKKO EKORG EKORG

EKKO BEDAT EBDAT

EKPO WERKS EWERK

EKPO EBELP EBELP

EKPO MATNR MATNR

EKPO MENGE BSTMG

EKPO REVLV REVLV

MDSB MATNR MATNR

EKET EINDT EINDT

The export parameter e_cekko has only 4 fields out of these. and others are in import parameter it_bekpo and it_beket. But i am not getting MDSB-MATNR. As the above mentioned FM is a standard i cant add fields in that.

So i want to create a FM which gives all these fieds which i am already getting and 1 more field MDSB-MANTR. and then i will call this new Created FM in the standard one as it is a exit.

Can anyone create this FM

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

>>>

<i>the requirement is,

I have to send a customized IDOC to external application when a PO release. For sending IDOC automaticaly when PO release, I fount User exit M06E0004.</i>

<<<

OK.

I take you did verify that this user exit is only triggered when you release the PO. Just asking because it's purpose, as it was said, is to influence the release strategy determination. This determination may happen when the PO is saved, not when the PO is actually released. In that case, this would be too early. But I'm not certain about the exact processing time, to be honest.

If you determined that this is the right place, then it's all good.

>>>

<i>And IT_BEKPO, IT_BEKET are not internal tables , they are import parameters of table type MMPUR_BEKPO and MMPUR_BEKET.</i>

<<<

And what type do you think IT_BEKPO, etc. will be? Since they are defined with reference to a table type, they sure will be internal tables.

If you want to read the content, you'd do something like this:

DATA: W_BEKPO TYPE BEKPO.

LOOP AT IT_BEKPO INTO W_BEKPO WHERE... <conditions>

MOVE W_BEKPO-MENGE TO ...

...etc.

ENDLOOP.

As for reading MDSB, I don't know what your selection criterion is, but since MDSB is a view defined for table RESB, it only makes sense to use it if you do know the corresponding reservation number, item etc.

You mentioned MATNR as the field you'd need from MDSB. Why? If you need the material number, it's readily available in IT_BEKPO. If you need reservation data in your IDoc then you'd read RESB with a proper indexed access (so for instance, with the material number from the PO item or something)...

Regarding the whole 'sending IDoc when the PO is released' requirement, I'd probably try a different approach. My way of doing this would probably be to try to set up the regular message control with a specific output type generating the custom IDoc, and in the message determination I'd set a requirement that checks whether the PO is released... something like that.

0 Kudos

Thanks buddy,

I wil try doing the same ways its its an internal table.

And taking matnr from MDSB/RESB is because clint want child items(materials) which starts from 'G' for the material (item) while creating PO which only saves in RESB. and it has EBELN and EBELP.

I dont no how to take this field in my FM. as i have to pass this information in IDOC

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

If you want to read RESB with EBELN, you'll probably have to create an index on EBELN and EBELP since there isn't any - otherwise you might get a performance hit if there are a lot of reservation records.

Another way (without creating an index) would be to read RESB with material number and plant and then filter out the entries by EBELN / EBELP.

0 Kudos

So do i need to define RESB in import parameter or i can get values directly by select query ? and then read my READ stmt.

And i tried LOOP AT BEKPO its working man.

thanks buddy.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can use SELECT, no need to define anything as import parameter...