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 with SELECT SINGLE

Former Member
0 Likes
958

hi

can you find any error in this

select single * from makt where matnr = p_matnr and spras = 'sv'.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
935

HI.

SEE BELOW CODE PLZ..

data: BEGIN OF it_makt OCCURS 0,

matnr LIKE maKT-matnr,

maktx LIKE makt-maktx,

END OF it_makt.

data: process_tab_struct_tmp like IT_MAKT.

field-symbols: <fs1>.

after downloading file(excel) to excel_tab....code follows

LOOP AT EXCEL_TAB.

assign component excel_tab-col of structure

process_tab_struct_tmp to <fs1>.

<fs1> = excel_tab-value.

at end of row.

move-corresponding: process_tab_struct_tmp to IT_MAKT.

append IT_MAKT.

endat.

ENDLOOP.

if i check with this below statment...it's giving sy-subrc = 4. (but data there in makt)

select single * from MAKT where MATNR = it_makt-MATNR and SPRAS = 'E'.

my clue: any conversion problem with it_makt-matnr ......plz replay fats.

8 REPLIES 8
Read only

Former Member
0 Likes
935

Hi,

Change you code to

select single * from makt where matnr = p_matnr and spras = 'S'. OR

select single * from makt where matnr = p_matnr and spras = sy-langu.

Regards,

Atish

Read only

Former Member
0 Likes
935

Hi,

select single * from makt <b>into table <tablename></b> where matnr = p_matnr and spras = 'S'.

Regards,

Ameet

Read only

Former Member
0 Likes
935

Hi,

If u pass values in where field then it should be always capital letter. Anyways i hope ur issue got fixed.

Regards

Sathish:)

Read only

Former Member
0 Likes
935

Hi

Pass the value SPRAS in Capital letters

or declare variable for the same

Regards

Shiva

Read only

Former Member
0 Likes
936

HI.

SEE BELOW CODE PLZ..

data: BEGIN OF it_makt OCCURS 0,

matnr LIKE maKT-matnr,

maktx LIKE makt-maktx,

END OF it_makt.

data: process_tab_struct_tmp like IT_MAKT.

field-symbols: <fs1>.

after downloading file(excel) to excel_tab....code follows

LOOP AT EXCEL_TAB.

assign component excel_tab-col of structure

process_tab_struct_tmp to <fs1>.

<fs1> = excel_tab-value.

at end of row.

move-corresponding: process_tab_struct_tmp to IT_MAKT.

append IT_MAKT.

endat.

ENDLOOP.

if i check with this below statment...it's giving sy-subrc = 4. (but data there in makt)

select single * from MAKT where MATNR = it_makt-MATNR and SPRAS = 'E'.

my clue: any conversion problem with it_makt-matnr ......plz replay fats.

Read only

0 Likes
935

Hi,

yes you are right. You need to convert MATNR.

USe CONVERSION_EXIT_ALPHA_INPUT to convert the material number.

or use CONVERSION_EXIT_MATN1_INPUT

Reward points if useful.

Regards,

Atish

Read only

0 Likes
935

thanks atish

if i use CONVERSION_EXIT_MATN1_INPUT

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

INPUT =

IMPORTING

OUTPUT =

input =???

output=??? according to my code plz suggest will get 6 points:)

Read only

0 Likes
935

Hi,

Use like this.

data: BEGIN OF it_makt OCCURS 0,

matnr LIKE maKT-matnr,

maktx LIKE makt-maktx,

END OF it_makt.

data: process_tab_struct_tmp like IT_MAKT.

field-symbols: <fs1>.

after downloading file(excel) to excel_tab....code follows

LOOP AT EXCEL_TAB.

assign component excel_tab-col of structure

process_tab_struct_tmp to <fs1>.

<fs1> = excel_tab-value.

at end of row.

move-corresponding: process_tab_struct_tmp to IT_MAKT.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

INPUT = <b>it_makt-matnr</b>

IMPORTING

OUTPUT = <b>it_makt-matnr</b>.

append IT_MAKT.

endat.

ENDLOOP.

Do reward points to useful answers.

Regards,

Atish