Skip to Content
0
Jan 30, 2021 at 02:23 AM

SETLEAF in SELECT CASE STATEMENT

64 Views

Dear folks,

I am new to ABAP. I am stuck below.

I have created a set table for GL accounts (SKA1-SAKNR) and retrieved the values to an internal table int_values using CALL FUNCTION 'G_SET_GET_ID_FROM_NAME'.

Now, my requirement is to use the values in the int_values in my below CASE statement to replace the hardcoded GL values.

SELECT a~rldnr, a~rbukrs,a~belnr, a~gjahr,a~blart,a~budat,a~buzei,a~racct,a~kunnr,a~koart,a~rhcur,a~hsl,a~umskz,a~bstat, a~gkont, a~bschl,

CASE

WHEN a~gkont EQ '0011001060' THEN CAST( a~hsl * -1 AS DEC( 23, 2 ) )

END AS hsl_cash,

Regards,