2008 Mar 17 5:05 AM
Hi all,
I've to loop on select options so tat i dnt want to take unwanteed fields into the ITAB. I want to check the select option one by one in a table and if its present then i want to retrive the data from another table.
is it possible to do so?
2008 Mar 17 5:11 AM
loop at s_matmr.
if s_matnr-(low/High/sign/option) = <value>.
<process as per ur need>
endif.
endloop.
loop at s_matmr.
if s_matnr-(low/High/sign/option) = <value>.
<process as per ur need>
endif.
endloop.
2008 Mar 17 5:06 AM
the way we loop at internal table you can loop at select option
loop at s_matnr
if s-matnr = '99'
......
ENDLOOP.
2008 Mar 17 5:08 AM
Hi,
Use
SELECT-OPTIONS: BEGDA FOR PA0000-BEGDA NO INTERVALS.
AWARD POINTS IF USEFUL
2008 Mar 17 5:12 AM
Hi,
As assumptions consider the following coding,
It will solve ur problem.
SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.
DATA : BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF ITAB.
START-OF-SELECTION.
LOOP AT S_MATNR.
IF S_MATNR-LOW = '22222'.
MOVE : S-MATNR-LOW TO ITAB-MATNR.
APPEND ITAB.CLEAR ITAB.
**DO UR CHECKING HERE ***
ENDIF.
ENDLOOP.Regards,
Balakumar.G.
Rewards Points If helpful.
2008 Mar 17 5:09 AM
If you loop the select-option, there will be one loop for each row of the select option. So to get all the valid fields between a low value to high value in a select option you need to have a select statement in the check table.
Suppose for material no (Matnr) the check table in MARA and your select-option is s_matnr. then
1. Select all the valid values into gt_matnr table.
select matnr from mara into table gt_mannr
where matnr in s_matnr.
2.Now you can loop gt_matnr instead
loop at gt_matnr.
************ put your logic
endloop.
2008 Mar 17 5:11 AM
Hi,
if u create a select-options internally it will create an internal table with fields high,low,option and sign.u can use it like a normal one.
rgds,
bharat.
2008 Mar 17 5:11 AM
loop at s_matmr.
if s_matnr-(low/High/sign/option) = <value>.
<process as per ur need>
endif.
endloop.
2008 Mar 17 5:14 AM
Hi Sunny,
Say u want to check the existance of entered MATNR in MARC, and get the MATNR and WERKS relation from MARD.For this u code like this
TABLES mard.
select-options s_matnr FOR MARD-MATNR.
DATA IT_MARD TYPE TABLE OF MARD.
SELECT * INTO TABLE IT_MARD FROM MARD JOIN MARC ON MARCMATNR = MARCMATNR
WHERE MARC~matnr IN S_MATNR.
Thanks Arjun
2008 Mar 17 5:15 AM
hi
It s cool job only.. If u create a Select-options, it l create a internal table like structure like
-option
-sign
-low
-high
Sign is to show Sign of a particular value..
Low-- Low value in ranges
high--high value in ranges
2008 Mar 17 5:17 AM
select-options:s_option for *********.
at selection screen on s_option.
if not s_option is initial.
u can do ur part here or u can check s_option-low or s_option-high.
endif.
2008 Mar 17 5:17 AM
hI,
Refer to the sample code below.
LOOP AT s_lgort.
IF NOT s_lgort-low IS INITIAL.
SELECT SINGLE lgort
FROM t001l
INTO l_lgort
WHERE lgort = s_lgort-low.
IF sy-subrc NE 0.
MESSAGE e000 WITH text-e01.
ENDIF.
ENDIF.
ENDLOOP.
Hope it helps.
Regards,
Ramya
2008 Mar 20 4:51 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |