09-11-2020 4:23 PM
HI
I want to know how to pass select option as import parameter in any SAP standard function module..
select option : s_matnr for matnr.
CALL FUNCTION 'Standard FM'
Import parameter = s_matnr
09-11-2020 5:14 PM
s_matnr is basically a range table type. But you may need to convert it.
try a function module with input variable of type MD_RANGE_T_MATNR
09-11-2020 5:23 PM
Hello,
It is not possible to send the select option structure in the input of the standard BAPI unless the BAPI import structure allows range table.
If you call the standard BAPI then there are different approach based on the BAPI import structure :
Thanks and Regards,
Tanaya Das
09-11-2020 8:48 PM
Hi,
Thank u..
The parameter in bapi is a simlle like parameter... Eg. Mantr like marc-matnr..
Then how to do...
Can u pls help
09-12-2020 5:04 AM
Hi,
You can do as the following:
1. Convert s_matnr to a range table.
2. LOOP that range table.
3. CALL FUNCTION 'Standard FM'.
Example for step 2 & 3:
LOOP AT itab_range_matnr INTO DATA(wa_matnr).
CALL FUNCTION 'Standard FM'
Import parameter = wa_matnr-matnr.
ENDLOOP.
Regards,
09-12-2020 10:39 AM
ak6155 I doubt that "The parameter in bapi is a simlle like parameter... Eg. Mantr like marc-matnr.." because BAPI don't have short names like MATNR, they have long names like MATERIAL_NUMBER. Or maybe you mean a RFC-enabled function module? (not a BAPI). What BAPI is it, what parameter is it?
To complete nguyenthanhket9398 answer, in step 1 you may also determine the list of all material numbers directly from the table MARA:
SELECT matnr FROM mara WHERE matnr IN s_matnr INTO TABLE @DATA(matnr_s).
LOOP AT matnr_s INTO DATA(matnr).
CALL FUNCTION 'BAPI_...'
EXPORTING
material_number = matnr
...