cancel
Showing results for 
Search instead for 
Did you mean: 

User Exit Enhancement - Issue

Former Member
0 Kudos

Hi All,

I have enhanced the user exit. Before I do this I have tested the piece of code in an ABAP program in the same box and got exactly what it should extract. I cut and pasted the same code in the user exit and it is not working. I have copied all the declaration etc.

Also there is another piece of code that works in the same exit for the same data source, but the other block of code is not executing. I found the SQL statement within the user exit is returning SUBRC as 4 and skippin my condition.

Any suggestion.

Thanks,

Alex.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

closing it.

Former Member
0 Kudos

is M_AUFNR is a table, then you should use this code

SELECT QMNUM QMART OBJNR AUFNR FROM QMEL INTO corresponding fields of TABLE i_QMEL

for all entries in M_AUFNR

WHERE AUFNR = M_AUFNR-AUFNR

Former Member
0 Kudos

I found the SQL statement within the user exit is returning SUBRC as 4 and skippin my condition.

which statement is returning 4?

Former Member
0 Kudos

Raj,

The same SQL statment given above is returning return code 4 with in user exit, and returning 0 in the program.

Former Member
0 Kudos

surely looks like a code issue. Do you know what condition is returning sysubrc to be 4. that needs to be checked.

Former Member
0 Kudos

The SQL statement that I use in the program in the same environment works, when it is outside the user exit.

Do you have yr email I can send the code and have a look if you can..

The SQL in User Exit.

SELECT QMNUM QMART OBJNR AUFNR INTO TABLE i_QMEL FROM QMEL WHERE AUFNR = m_AUFNR.

The SQL in the program.

SELECT QMNUM QMART OBJNR AUFNR INTO TABLE i_QMEL FROM QMEL WHERE AUFNR = m_AUFNR.

Former Member
0 Kudos

SELECT QMNUM QMART OBJNR AUFNR INTO corresponding fields of TABLE i_QMEL FROM QMEL WHERE AUFNR = m_AUFNR.

make sure that the field names in i_QMEL and QMEL are defined the same.

Edited by: Raj Coppar on Sep 22, 2008 9:52 AM

Former Member
0 Kudos

Raj,

The fields in the internal table i_QMEL and the order in which it is in the SQL are correct. But I have added the corresponding clause anyway.

Thanks,

Alex.

Former Member
0 Kudos

here try this:

SELECT QMNUM QMART OBJNR AUFNR FROM QMEL INTO corresponding fields of TABLE i_QMEL WHERE AUFNR = m_AUFNR.

is QMEL a table by itself?

Former Member
0 Kudos

Yes.

Former Member
0 Kudos

still does not work?

Former Member
0 Kudos

Raj,

Yes, it does not work. That is why I am struggling. I tested the code in SE38 as an ABAP program in ECC. Then I cut and put the same code in the user exit, it does not work. The SQL statement return code = 4.

It is a simple Character length field 12. I know for sure it is something simple I am overlooking... any ideas?

Thanks,

Alex.

Former Member
0 Kudos

try this:

SELECT QMNUM QMART OBJNR AUFNR FROM QMEL INTO corresponding fields of TABLE i_QMEL WHERE AUFNR = QMEL-m_AUFNR.

so you are sure that there is a record with this selection criteria.

check to see that. if there are no records then it will return 4.

former_member199630
Contributor
0 Kudos

Hi, I suppose that your variable m_AUFNR is the same type of AUFNR in the table, isn't it?. I mean:

m_AUFNR TYPE QMEL-AUFNR.

Regards, Federico