on 10-19-2006 10:43 AM
When I hardcode a value the program works. The output is generated! To be sure the variable: <traptab>-matnr
is filled correctly I inserted the variable into a table just prior to the Call FUNCTION and I can see the value is correct.
Also, I run this exact same logic in a standalone pgm and it works fine.
There are no compile errors, or runtime errors...
So what is going on???
Help...
Thanks,
Vincent
1) l_textname = <traptab>-matnr.
2) l_textname = '956771-CH1'.
3)
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'PRUE'
LANGUAGE = gv_language
NAME = l_textname
OBJECT = 'MATERIAL'
TABLES
lines = text_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6.
Thanks,
Vince
Solved!!!
Hey guys,
You are great.
Of course not all of my materials have inspection text. So the first time I LOOPed into a material that had no STXL then I raised a message...
Silly me.
So by commenting the message... everything is cool.
Many thanks,
Vincent
p.s., I am not sure how to award points....but thanks a lot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks guys,
These were all wonderful suggestions. I tried condense and also the conversion exit. But, still no cigar.
I am not sure how to run the form in debug mode.
I invoke the form by running transaction /nMB02 and doing a change document. I hardcode a break-point but it never stops there. I tried turning on SFTRACE but it still does not stop there. I think if I could step through it I might see something.
Otherwise I am shooting in the dark.
Thanks and try to come up with some other ideas,
Vincent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Don't condense the material number. The function module expects the complete material number including leading zeros also.
Please check the below code. It is working fine for this requirement.
Please check the below code.
REPORT ZRKPROGRAM4 .
DATA: V_ID LIKE THEAD-TDID,
V_LANGUAGE LIKE THEAD-TDSPRAS,
V_NAME LIKE THEAD-TDNAME,
V_OBJECT LIKE THEAD-TDOBJECT,
T_LINES LIKE TLINE OCCURS 0 WITH HEADER LINE.
DATA: V_MATNR LIKE MARA-MATNR.
PARAMETER: P_MATNR TYPE MATNR.
START-OF-SELECTION.
V_ID = 'PRUE'.
V_LANGUAGE = 'E'.
V_OBJECT = 'MATERIAL'.
*The get complete material length including leading zeros
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = P_MATNR
IMPORTING
OUTPUT = V_MATNR .
V_NAME = V_MATNR.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = V_ID
LANGUAGE = V_LANGUAGE
NAME = V_NAME
OBJECT = V_OBJECT
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = T_LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT T_LINES.
WRITE:/ T_LINES-TDLINE.
ENDLOOP.
Thanks,
ramakrishna
The problem may be with data format.
Use this function module,
CONVERSION_EXIT_MATN1_INPUT
Pass the material no first into this function mdouel and get the output into varible.Use this value in the read_text.
Try this way and let me know if u face any problem.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vincent,
You could run your program in debug mode for the scenario wherein you've assigned l_textname = <traptab>-matnr. Check if the format of your material is the same as what you are expecting it. The value '956771-CH1' might already be the converted output for this material and is different from the internal format of your material. Hence, this will give a different result.
Example:
Output Format: '956771-CH1'
Internal Value: 000000000956771CH1
If such is the case, you could use the conversion exit to properly convert your material to required format.
Kind Regards,
Darwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try and condense the variable before the call function..that might help.
It is basically the format which is causing the issue eg trailing spaces etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.