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

Former Member
0 Likes
891

SELECT RSEGBELNR RSEGEBELN RSEGGJAHR RSEGLFBNR

RSEGLIFNR RSEGSHKZG RSEGWERKS RSEGWRBTR

RBKPBLART RBKPRMWWR RBKP~STBLG

RBKPVGART RBKPWAERS

INTO table itab_j

FROM ( RSEG

INNER JOIN RBKP

ON RBKPBELNR = RSEGBELNR

AND RBKPGJAHR = RSEGGJAHR )

WHERE RSEG~lfbnr = '10000040'.

why i dont get data into itab_j and in abapquery i get?

i declare itab_j same as the field in the select.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
852

Hi Rani,

Use the following conversion exit on LFBNR before processing SELECT query.

<b>CONVERSION_EXIT_ALPHA_INPUT</b>.

If you specify same value at SELECTION-SCREEN through PARAMETERS/SELECT-OPTIONS with defintion RSEG-LFBNR then conversion exits will automatically trigger and the conversion exit values will be processed in SELECT query.

If you hardcode directly in SELECT statement, it wont perform any CONVERSION EXITs.So we need to handle it through CONVERSION EXITS.

<b>Note: Plz reward points to all helpful answers and close thread if is solved</b>

Thanks,

Vinay

7 REPLIES 7
Read only

Manohar2u
Active Contributor
0 Likes
852

Try with packing RSEG~lfbnr with '0010000040'

Use conversion FM to suffice the above requirement if it works.

Regds

Manohar

Read only

Former Member
0 Likes
853

Hi Rani,

Use the following conversion exit on LFBNR before processing SELECT query.

<b>CONVERSION_EXIT_ALPHA_INPUT</b>.

If you specify same value at SELECTION-SCREEN through PARAMETERS/SELECT-OPTIONS with defintion RSEG-LFBNR then conversion exits will automatically trigger and the conversion exit values will be processed in SELECT query.

If you hardcode directly in SELECT statement, it wont perform any CONVERSION EXITs.So we need to handle it through CONVERSION EXITS.

<b>Note: Plz reward points to all helpful answers and close thread if is solved</b>

Thanks,

Vinay

Read only

0 Likes
852

data: begin of itab_j occurs 0,

belnr like RSEG-BELNR,

ebeln like RSEG-EBELN,

gjahr like RSEG-GJAHR,

lfbnr like RSEG-LFBNR,

lifnr like RSEG-LIFNR,

shkzg like RSEG-SHKZG,

werks like RSEG-WERKS,

wrbtr like RSEG-WRBTR,

blart like RBKP-BLART,

rmwwr like RBKP-RMWWR,

stblg like RBKP-STBLG,

vgart like RBKP-VGART,

waers like RBKP-WAERS,

end of itab_j.

loop at itab assigning <ls_itab>.

data: z_lblni like essr-lblni.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = <ls_itab>-lblni

IMPORTING

OUTPUT = z_lblni.

SELECT RSEGBELNR RSEGEBELN RSEGGJAHR RSEGLFBNR

RSEGLIFNR RSEGSHKZG RSEGWERKS RSEGWRBTR

RBKPBLART RBKPRMWWR RBKP~STBLG

RBKPVGART RBKPWAERS

INTO table itab_j

FROM ( RSEG

INNER JOIN RBKP

ON RBKPBELNR = RSEGBELNR

AND RBKPGJAHR = RSEGGJAHR )

WHERE RSEG~lfbnr = z_lblni.

i treis and it's not work????

Read only

0 Likes
852

i get sydbcnt = 2 but i dont see the data in the itab

Read only

0 Likes
852

Rani,

Is this select statement is in loop?

or does this field z_lblni is only a variable for your select?

Regds

Mnaohar

Read only

0 Likes
852

in loop.

Read only

0 Likes
852

Try using this type of select if the select is in loop.

SELECT ... INTO|<b>APPENDING</b> [CORRESPONDING FIELDS OF] TABLE <itab>

Regds

Manohar