2009 Jan 14 7:21 AM
Hello Experts,
I want to create a function module which takes input as material number.
but how to make input parameter for material as it can take multiple material number at the time?
Regards
RH
2009 Jan 14 7:54 AM
Hello Ronny,
how to make input parameter for material as it can take multiple material number at the time?
For this you need to have a range table for Material No.(MATNR).
SAP has provided a range table for MATNR - RANGE_T_MATNR(Range Table for Data Element MATNR). You can define your input parameter for material as import param:
R_MATNR TYPE RANGE_T_MATNRHope this will help.
BR,
Suhas
Hi,
Declare and fill the range as under and then pass it to function module
ranges: rkunnr for kna1-kunnr.
rkunnr-sign = 'I'. rkunnr-option = 'EQ'.
select kunnr from zsdo into rkunnr-low
append rkunnr to rkunnr.
endselect.Use it just like Select-Option
select * from kna1
into CORRESPONDING FIELDS OF TABLE it_kan1
WHERE kunnr in rkunnr.Define this Range in the "Tables" Tab in Function Module.
King Regards,
Faisal
Edited by: Faisal Altaf on Jan 14, 2009 2:19 PM
2009 Jan 14 7:26 AM
Hi,
Use Select Options like the following and from the extension button you can give multiple values,
SELECT-OPTIONS: soregio FOR kna1-regio NO INTERVALS OBLIGATORY.Replay if any Problem,
Kind Regards,
Faisal
Edited by: Faisal Altaf on Jan 14, 2009 12:27 PM
2009 Jan 14 7:30 AM
2009 Jan 14 7:32 AM
Use TABLES Parameter instead of IMPORT Parameter for multiple input.
2009 Jan 14 7:33 AM
Hi,
For more detail about the select option have a look at the following code.
TABLES: kna1.
SELECT-OPTIONS: soregio FOR kna1-regio NO INTERVALS OBLIGATORY.
data: it_kan1 like STANDARD TABLE OF kna1 WITH HEADER LINE,
wa_it_kna1 like kna1.
select * from kna1
into CORRESPONDING FIELDS OF TABLE it_kan1
WHERE regio in soregio. "if you will give two region using the extension buttion it will select the all records have these two regionsKind Regards,
Faisal
2009 Jan 14 7:54 AM
Hello Ronny,
how to make input parameter for material as it can take multiple material number at the time?
For this you need to have a range table for Material No.(MATNR).
SAP has provided a range table for MATNR - RANGE_T_MATNR(Range Table for Data Element MATNR). You can define your input parameter for material as import param:
R_MATNR TYPE RANGE_T_MATNRHope this will help.
BR,
Suhas
2009 Jan 14 7:56 AM
Hi,
Declare and fill the range as under and then pass it to function module
ranges: rkunnr for kna1-kunnr.
rkunnr-sign = 'I'. rkunnr-option = 'EQ'.
select kunnr from zsdo into rkunnr-low
append rkunnr to rkunnr.
endselect.Use it just like Select-Option
select * from kna1
into CORRESPONDING FIELDS OF TABLE it_kan1
WHERE kunnr in rkunnr.Define this Range in the "Tables" Tab in Function Module.
King Regards,
Faisal
Edited by: Faisal Altaf on Jan 14, 2009 2:19 PM
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |