Skip to Content
-2

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

Jun 12, 2017 at 09:16 AM

142

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
Former Member

I have followed by :

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

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.

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Chintu adi Jun 12, 2017 at 10:10 AM
0

Hello,

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

thank you!!

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

input-to-fm.jpg (63.0 kB)
input-to-fm2.jpg (24.9 kB)
0
Raymond Giuseppi
Jun 12, 2017 at 01:35 PM
0

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks Raymond.

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

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

0
avatar image
Former Member Jun 16, 2017 at 07:51 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded