Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

select option looping

Former Member
0 Kudos

i have 5 select options on the screen. i want to take each select option .e.g one to one correpondence... I have to use a select query looping on the select option and send mails depending on the select query. also i have to concatenate the select option values in a variable

3 REPLIES 3

Former Member
0 Kudos

hi

hope it will help you.

Pls reward if help.

SELECT-OPTIONS: BEDAT FOR EKKO-BEDAT.

SELECT-OPTIONS: EBELN FOR EKKO-EBELN.

SELECT-OPTIONS: MATNR FOR EKPO-MATNR.

SELECT-OPTIONS: EREKZ FOR EKPO-EREKZ.

SELECT-OPTIONS: KOSTL FOR EKKN-KOSTL.

SELECT-OPTIONS: AUFNR FOR EKKN-AUFNR

DATA: INT LIKE ZSIMM_PO_HISTORY OCCURS 0 WITH HEADER LINE.

DATA: LW_EKKO TYPE EKKO,

LW_EKPO TYPE EKPO,

LW_EKKN TYPE EKKN,

LW_LFA1 TYPE LFA1.

SELECT * FROM EKKO INTO LW_EKKO

WHERE ( EBELN IN EBELN ) AND

( BEDAT IN BEDAT ).

CLEAR: INT.

IF SY-SUBRC = 0.

MOVE-CORRESPONDING LW_EKKO TO INT.

ENDIF.

SELECT * FROM EKPO INTO LW_EKPO

WHERE ( EBELN = LW_EKKO-EBELN ) AND

( MATNR IN MATNR ) AND

( EREKZ IN EREKZ ).

CLEAR: INT.

MOVE-CORRESPONDING LW_EKKO TO INT.

IF SY-SUBRC = 0.

MOVE-CORRESPONDING LW_EKPO TO INT.

ENDIF.

*SELEKCIJSKI EKRAN ZA CC IN ORDER

CLEAR: EKKN.

SELECT SINGLE * FROM EKKN WHERE ( EBELN = LW_EKPO-EBELN ) AND

( EBELP = LW_EKPO-EBELP ) AND

( KOSTL IN KOSTL ) and

( AUFNR IN AUFNR ).

MOVE EKKN-KOSTL TO INT-KOSTL.

MOVE EKKN-AUFNR TO INT-AUFNR.

CALL FUNCTION 'ME_READ_HISTORY'

EXPORTING

EBELN = LW_EKPO-EBELN

EBELP = LW_EKPO-EBELP

WEBRE = ' '

TABLES

XEKBES = BETS.

LOOP AT BETS WHERE ZEKKN EQ SPACE.

MOVE-CORRESPONDING BETS TO INT.

APPEND INT.

ENDLOOP.

IF SY-SUBRC NE 0.

APPEND INT.

ENDIF.

REFRESH BETS.

CLEAR: LW_EKPO.

ENDSELECT.

CLEAR: LW_EKKO.

ENDSELECT.

Former Member
0 Kudos

Am presuming below characteristics for your select-options:

1. No Intervals

2. Only accepts sign EQ.

3. One to One correspondence in the sense all select-options have equal number of records.

If so try as below:


DO.
  READ TABLE so_sel1.
  IF SY-SUBRC NE 0.
     EXIT.
  ELSE.
     READ TABLE so_sel2.
     READ TABLE so_sel3.
     ...
     ...
     
     CONCATENATE so_sel1-low so_sel2-low ....
        INTO l_string.
        
     perform process ...
  ENDIF.
ENDDO.

Regards

Eswar

Former Member
0 Kudos