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: 

How to input Screen field value (DFBATCH-MATNR of MSC2N ) to z function module

Former Member
0 Kudos

I want to import screen field value (

DFBATCH-MATNR)

to my z function module to validate the batch charactersics . Kindly help me.

Regards,

Sanjay Deshpande

6 REPLIES 6

Chintu6august
Contributor
0 Kudos

Hello,

You can make use of FM READ_TEXT to read DFBATCH or parameter id of MATNR.

thank you!!

0 Kudos

I have created new Batch Characteristics with t-code ct04

Now I required to write code to validate this field in above function. My requirement is how to capture material code and plant from following screen:

Thanks & Regards,

Sanjay Deshpande

raymond_giuseppi
Active Contributor
0 Kudos

In your FM you could analyze the memory of the caller (function group CHRG) as DFBATCH is declared there with a TABLES statement. The data is available. Call SYSTEM_CALLSTACK to insure you are in the correct transaction. Then use either a wild assign statement (to "(SAPLCHRG)DFBATCH") or just get parameter id MAT.

NB: Of course when the characteristics is changed thru BAPI or classification classes you will have to adapt your code. Another solution is to provide a wide generoc value list in the FM, and then perform some check(s) in method CHECK_CLASSIF_BEFORE_SAVE of BAdI BATCH_MASTER.

0 Kudos

Thanks Raymond.

By referring https://blogs.sap.com/2013/05/14/create-new-batch-characteristics-with-values-checked-and-suggested-...

I have created z function module to validate the batch characteristics value. In this function there are are Import, Export,Changing, Table tabs are blank. I am passing "(SAPLCHRG)DFBATCH" parameters to FM : REUSE_ALV_POPUP_TO_SELECT which is used in Z function module. I am getting selected output value but unable to pass the same or assign to the batch characteristics of MSC2N screen field (batch characteristics value).

Please help.

- Sanjay

Former Member
0 Kudos

I have followed by :

https://blogs.sap.com/2013/05/14/create-new-batch-characteristics-with-values-checked-and-suggested-...

With the above link procedure I can get filter popup data but while returning to the main screen of batch characteristics value not restoring to the field.

Kindly help me.

Former Member
0 Kudos

You can try with this function module 'CLFM_SELECT_AUSP' to read material characteristics.

pass the values as: 'O' to mafid / '001' to classtype & pass the object.

Regards,

Suren.