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

Select Single

Kishore_
Explorer
0 Likes
1,416

Hi All,

I'm using select single matnr werks into (lv_matnr, lv_werks) from marc where matnr = matnr.

While executing it showing dump error.

I know to use workarea or table but i need to achieve in this way.If i use single field(matnr) its working fine.

Can you suggest

Regards

Kishore

6 REPLIES 6
Read only

rnb86
Participant
0 Likes
1,045

HI,

check how the variable LV_WERKS is defined.

It can be defined in 2 ways:

data lv_werks type werks_d.

or

data lv_werks type mard-werks.

Read only

Former Member
0 Likes
1,045

Hi,

make sure that lv_werks is of type WERKS_D, not of type WERKS ....

Regards,

Klaus

Read only

Former Member
0 Likes
1,045

Hi,

Please debug and check at what line system is giving a dump error. I think you have created structures lv_matnr and lv_werks in case of variables or the target datatypes must be different. Also you shall not get single record with matnr in MARC table. You also need to give werks for selecting a unique record. Try this.


TYPES: BEGIN OF ty_marc,
       matnr TYPE marc-matnr,
       werks TYPE marc-werks,
       END OF ty_marc.

DATA: wa_marc TYPE ty_marc.

SELECT SINGLE matnr werks
  FROM marc
  INTO wa_marc
  WHERE matnr EQ p_matnr
  AND   werks EQ p_werks.
IF sy-subrc NE 0.
  MESSAGE 'No Data' TYPE 'S' DISPLAY LIKE 'E'.
  LEAVE LIST-PROCESSING.
ENDIF.

Regards,

Danish.

Read only

Former Member
0 Likes
1,045

For single matnr there are multiple werks in MARC .. so what werks u want to select ????

I have tried with your code but did not found any issue

data : lv_matnr type MATNR,
      lv_werks type WERKS_D.
select single matnr werks
  into (lv_matnr,lv_werks)
  from marc where matnr = '000000000013723112'.
  write  : lv_matnr, lv_werks.

Edited by: KaushiK©Datta on Mar 9, 2012 2:23 PM

Read only

former_member16553
Active Participant
0 Likes
1,045

Hi

Can you please share the dump error you got.

Thanks

Girdhari

Read only

Kishore_
Explorer
0 Likes
1,045

Solved Thanks