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

user exit in bex query

Former Member
0 Likes
825

Hi Gurus,

I am not so good in abap so can anyone help me with the coding for the logic which i have mentioned below. I want to do it in EXIT_SAPMRSRU_001. This exit for th virtual characteristics.

Create TEMP table with temp field A , Temp field B

Get Field A, pass it to temp A,

Do a search in TEMP-temp field A

if not found in temp A, copy field to temp field A , assign temp B =1

if found in temp A, copy field to temp field A , assign temp B =0

Put the above logic in a loop until final record is read.

Edited by: Alvaro Tejada Galindo on Feb 28, 2008 1:55 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
793

TYPES: BEGIN OF TY_TEMP,
       FIELD_A TYPE STRING,
       FIELD_B TYPE STRING,		
       END OF TY_TEMP.

DATA: T_TEMP TYPE STANDARD TABLE OF TY_TEMP.

FIELD-SYMBOLS: <FS_TEMP> LIKE LINE OF T_TEMP.

LOOP AT T_TEMP ASSIGNING <FS_TEMP>.
IF <FS_TEMP>-FIELD_A NE PARAM_A.
<FS_TEMP>-FIELD_A = PARAM_A.
<FS_TEMP>-FIELD_B = 1.
ELSE.
<FS_TEMP>-FIELD_A = PARAM_A.
<FS_TEMP>-FIELD_B = 0.
ENDIF.
MODIFY T_TEMP FROM <FS_TEMP>.
ENDLOOP.

Modify it, according to your needs...And next time, try the code yourself first -;)

Greetings,

Blag.

Hi Gurus,

I am not so good in abap so can anyone help me with the coding for the logic which i have mentioned below. I want to do it in EXIT_SAPMRSRU_001. This exit for th virtual characteristics.

Create TEMP table with temp field A , Temp field B

Get Field A, pass it to temp A,

Do a search in TEMP-temp field A

if not found in temp A, copy field to temp field A , assign temp B =1

if found in temp A, copy field to temp field A , assign temp B =0

Put the above logic in a loop until final record is read.

Edited by: Alvaro Tejada Galindo on Feb 28, 2008 1:55 PM

5 REPLIES 5
Read only

Former Member
0 Likes
794

TYPES: BEGIN OF TY_TEMP,
       FIELD_A TYPE STRING,
       FIELD_B TYPE STRING,		
       END OF TY_TEMP.

DATA: T_TEMP TYPE STANDARD TABLE OF TY_TEMP.

FIELD-SYMBOLS: <FS_TEMP> LIKE LINE OF T_TEMP.

LOOP AT T_TEMP ASSIGNING <FS_TEMP>.
IF <FS_TEMP>-FIELD_A NE PARAM_A.
<FS_TEMP>-FIELD_A = PARAM_A.
<FS_TEMP>-FIELD_B = 1.
ELSE.
<FS_TEMP>-FIELD_A = PARAM_A.
<FS_TEMP>-FIELD_B = 0.
ENDIF.
MODIFY T_TEMP FROM <FS_TEMP>.
ENDLOOP.

Modify it, according to your needs...And next time, try the code yourself first -;)

Greetings,

Blag.

Read only

0 Likes
793

Thank you very much. Appreciated.

Full points given.

Edited by: satish rajaram on Feb 28, 2008 2:29 PM

Read only

0 Likes
793

Hi

Your code is fine except for it is giving an error for the PARAM_A.

Field "PARAM_A" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement.

Can you please help me wat to do now. If you can help me with this that will be great.

Regards

Satish.

Read only

0 Likes
793

PARAM_A should be the field that is coming from the User-Exit...So you don't need to declare it...

EXIT_SAPMRSRU_001 doesn't exists on my system...So I can't give more details...

Greetings,

Blag.

Read only

0 Likes
793

Thank you very much for your help. i will try to get sort it out my self and let you know.

Points have been given.