07-21-2009 11:19 AM
Is it possible to pass value in module?
chain.
field xxx module check_data .....
endchain.
07-21-2009 11:25 AM
Hi,
<li>It is possible to check.
CHAIN.
FIELD MARA-MATNR MODULE check_data.
ENDCHAIN.
Thanks
Venkat.O
MODULE check_data INPUT.
"Write your code here and validate your input to the field MATNR on screen.
ENDMODULE.
07-21-2009 11:26 AM
What do you mean by "pass value"? Once you declare corresponding field (same name and type as screen field) in ABAP program, the value for that field will automatically be passed back and forth to program and screen.
07-21-2009 11:29 AM
Hello Frn,
It is not possible to pass the vaue ...
Thanks and Regards..
Priyank dixit
07-21-2009 11:32 AM
Hi,
Value will be automatically passed when you create the variable with same name in your ABAP program.
Regards
Milan
07-21-2009 11:37 AM
I have the following situation:
chain.
FIELD p9115-data_imputaz MODULE check_data.
.
.
.
.
endchain.
module CHECK_DATA input.
CALL FUNCTION 'ZCHECK_DATA'
EXPORTING
data_in = p9115-data_imputaz
.
endmodule.
I want to utilize the module check_data also with other field but I have need to change dinamically the exporting parameter for function module.
07-21-2009 12:10 PM
Ok, so this is what you need
"in screen flow logic
chain.
FIELD: field, field2 MODULE check_data.
enchain.
"in program
DATA: field(14) TYPE c, "example fields
field2(14) TYPE c.
DATA: fieldname TYPE string.
FIELD-SYMBOLS <value> TYPE ANY.
module CHECK_DATA input.
GET CURSOR FIELD fieldname. "gets current field name (the one which you are in)
ASSIGN (fieldname) TO <value>. "get its value
"now declare FM parameter as data_in TYPE ANY so you can pass any value
CALL FUNCTION 'ZCHECK_DATA'
EXPORTING
data_in = <value>.
endmodule.
Regards
Marcin
07-21-2009 11:34 AM
Hi,
Why do you want to pass the value here ? The value which you are going to give in the module pool screen is going to be validated.
Thanks,
Sri.
07-21-2009 11:34 AM
It is not requried to pass value becz you have already declared the variable globally.
07-21-2009 11:44 AM
Hi Alfonso,
In a module pool, when you say:
FIELD var1 MODULE a
the value of 'var1' is automatically passed from the screen to the module. This happens when the field value is entered for the first time, or when the value is changed.
On encountering ENDMODULE, the processed value is returned.
Do you want to do a pass-by-value only? If that is what you ask, no that is not possible. The call is pass-by-reference, so the value of the variable changes as per the module's code.
Hope this is helpful! Please elaborate on your requirement, and I'll revert back.
Cheers,
Shailesh.
Always provide feedback for helpful answers!!