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

Logic

Former Member
0 Likes
575

Hi,

I am getting data(LABST) from MARD. I am entering the Matnr, werks.

And also i have to compare with LGORT(it is also Key field). if Storage location first Char 'M' or 'G', it has to retreive data. How can i compare matnr wrks and lgort

regards,Ajay Ram

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
548

Hi

Use below code.

Select matnr LGORT WERKS LABST from mard into table itab

where matnr = P_matnr and

Werks = p_matnr and

Lgort = 'M' or lgort = 'G'.

Reward me if its helpful.

Regards

Ravi

4 REPLIES 4
Read only

Former Member
0 Likes
548

Hi,

In WHARE Class write like this:

whare LGORT like 'M%' or LGORT like 'G%'.

Regards,

Bhaskar

Read only

ferry_lianto
Active Contributor
0 Likes
548

Hi,

Please try this.


PARAMETERS: P_MATNR LIKE MARD-MATNR,
            P_WERKS LIKE MARD-WERKS.
                                     
DATA: WA_LGORT LIKE MARD-LGORT.
                                 
SELECT SINGLE LGORT INTO WA_LGORT
FROM MARD
WHERE MATNR = P_MATNR
  AND WERKS = P_WERKS
  AND ( LGORT LIKE 'M%' OR LGORT LIKE 'G%' ).

Regards,

Ferry Lianto

Read only

0 Likes
548

HI Ferry,

I want to retrieve the LABST (Total Stock ) from MARD.

regards,Ajay Ram

Read only

Former Member
0 Likes
549

Hi

Use below code.

Select matnr LGORT WERKS LABST from mard into table itab

where matnr = P_matnr and

Werks = p_matnr and

Lgort = 'M' or lgort = 'G'.

Reward me if its helpful.

Regards

Ravi