2014 Feb 12 2:04 PM
HI ,
I have created a SAP query in sq02 and created 2 extra fields.
first extra field
Materialnumber (coding as below )
Move PRPS-USR01 to MaterialNumber .
and second field I have below coding
CLEAR :EXTERNALMATERIALGROUP.
SELECT single EXTWG
into EXTERNALMATERIALGROUP
from MARA
where ISMREFMDPRFAM = PRPS-USR00
AND MATNR = MATERIALNUMBER.( my first extra field )
now when I create sq01 query .my first field is populated with material number but second field is BLANK .
any idea WHY
Its quite URGENT . PLEASE help us .
Many Thanks
Regards
2014 Feb 12 2:10 PM
Hi Preeti,
Is the data present in MARA against the selection criteria?
What's the data type of MATERIALNUMBER? It should be same as of MATNR.
Can you try to debug the code and check?
Thanks
Amit
2014 Feb 12 2:09 PM
The most obvious reason is that the select was empty. Put a break point in the code and find out what it returned.
Neal
2014 Feb 12 2:10 PM
Hi Preeti,
Is the data present in MARA against the selection criteria?
What's the data type of MATERIALNUMBER? It should be same as of MATNR.
Can you try to debug the code and check?
Thanks
Amit
2014 Feb 12 2:25 PM
Hi amit .
There is lots of data in MARA table .I am getting at materialnumber but externalmaterial not getting .
screen shot .
can you please tell me how to debug this code .
2014 Feb 12 3:34 PM
Hi Preeti,
As said Neal you can put a break point in the code after your "select".
SELECT single EXTWG
.........................
AND MATNR = MATERIALNUMBER.
BREAK-POINT.
Regards
2014 Feb 12 3:51 PM
Break-point does not work in all systems.
Last i checked,
Break <user name>.
Still did.
If that doesn't work, the query generates ABAP code. Your select will be literally in that code. You can find it that way and put it in via debugger / se38 methods.
Neal
2014 Feb 12 5:59 PM
hi
i did put break point and got the below screen shot .
there i can see 2 values are coming for variables but Material group is blank.
now what should I do . I am new in ABAP .
2014 Feb 12 6:10 PM
There looks to be an issue with your 'where' clause. Table 'MARA' does not have a field ISMREFMDPRFAM.
2014 Feb 12 8:02 PM
The sy-subrc = 4 means that your select could not find a match. The most likely cause of this is that your material number must be 18 characters long with leading zeros for your select to work. Use the same conversion exit the it's domain uses before calling the select.
Neal
2014 Feb 13 7:48 AM
Could you please explain in detail how it can be that " Break-point does not work "
but the macro " Break <user name> " which based on statement " Break-point "
still do.
Boris
2014 Feb 13 10:00 AM
I will give your example of code.
DATA: materialnumber TYPE char18,
externalmaterialgroup TYPE mara-extwg.
CLEAR :externalmaterialgroup.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = materialnumber
IMPORTING
output = materialnumber
EXCEPTIONS
length_error = 1
OTHERS = 2.
SELECT single EXTWG
.........................
Regards
2014 Feb 13 8:00 AM
First execute SE11 and look for domain of
So before moving value from first to second field you must convert from external to internal format with CONVERSION_EXIT_MATN1_INPUT.
Nb: If there were no exit a simple MOVE would have been enough, with two different exits two conversions would have been required. field1 internal.->external , field 2 external->internal. with same exit and different length a conversion may also be required; e.g. more leading zeroes required if target field is longer with ALPHA conv. exit.
Regards,
Raymond