Application Development and Automation 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: 
Read only

Problem in Selection

SG141
Active Participant
0 Kudos
193

These are the select options.


SELECT-OPTIONS: 
                S_MATNR FOR MARA-MATNR ,
                S_MATKL FOR MARA-MATKL OBLIGATORY DEFAULT 'H*',
                S_WERKS FOR MARC-WERKS OBLIGATORY.

This is the select query


SELECT MARA~MATNR
             MARA~MATKL
             MARC~WERKS      
             FROM MARA AS MARA INNER JOIN MARC AS MARC
            ON MARA~MATNR = MARC~MATNR INTO TABLE GT_MARA
            WHERE MARA~MATNR IN S_MATNR AND
            MARA~MATKL IN S_MATKL AND
            MARC~WERKS IN S_WERKS.

S_MATKL internal table is having

s_sign = 'I'
s_option = 'EQ'
s_low = H*.

I know this works if <b>S_OPTION = CP</b>.

Let me know how can it be done.

4 REPLIES 4
Read only

Former Member
0 Kudos
166

Karthik,

use % instead of *.

reward if it helps,

Satish

Read only

SG141
Active Participant
0 Kudos
166
SELECT-OPTIONS: S_LAEDA FOR MARA-LAEDA OBLIGATORY,
                S_MATNR FOR MARA-MATNR ,
                S_MATKL FOR MARA-MATKL OBLIGATORY DEFAULT 'H*',
*               OPTION CP,  " adding this option
                S_MTART FOR MARA-MTART OBLIGATORY DEFAULT 'FERT',
                S_WERKS FOR MARC-WERKS OBLIGATORY.

Solved the problem.

Read only

naimesh_patel
Active Contributor
0 Kudos
166

Try like this:

SELECT-OPTIONS: 
                S_MATNR FOR MARA-MATNR ,
                S_MATKL FOR MARA-MATKL OBLIGATORY, " DEFAULT 'H*', << Comment
                S_WERKS FOR MARC-WERKS OBLIGATORY.

initialization.
 s_matkl-sign = 'I'
s_matkl-option = 'CP'
s_maktl-low = 'H*'.
append s_matkl.

Regards,

Naimesh Patel

Read only

Former Member
0 Kudos
166

Hi

  • is not treated as wild character . Instead use %

SELECT-OPTIONS:

S_MATNR FOR MARA-MATNR ,

S_MATKL FOR MARA-MATKL OBLIGATORY DEFAULT 'H%',

S_WERKS FOR MARC-WERKS OBLIGATORY.

Hope this work .

Praveen