‎2012 Feb 13 12:49 PM
Dear Experts,
Am looking to read Material Long text and push it to the legacy system with the material details.
Whenever i save the message am getting alll the details except Basic Data Text (Long Text). When i debug the code using the debugger(Classic/New) am getting the Long Text details. But am not able to find why the system is not fetching the Material Long Text in direct update(Without debugging).
Am using the FM READ_TEXT to read the Long Text and placing the code in the Enhancement Spot ES_SAPLMGMU in program SAPLMGMU.
‎2012 Feb 13 4:07 PM
HI
Have you tried to do a update debugging ? I am not sure what is the code that you are using but sometimes it might happen that when you are using debugging there might be enough time for the system to update and then you are able to retrieve the value from the table. Try to see if that is the issue else explain in detail what exactly you are trying to achieve in this enhancement spot.
Regards
Vijay V
‎2012 Feb 14 6:57 AM
Hi,
Can you post some of your codes here for us to analyze if it code error or not.
Thanks,
iostreamax
‎2012 Feb 14 9:22 AM
Hi all,
Below is the sample code used. My requirement is to fetch the Material details with Long text (Basic text) during material save and push it to legacy system.
L_NAME = MARA-MATNR.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = 'MATERIAL'
NAME = L_NAME
ID = 'GRUN'
LANGUAGE = SY-LANGU
SAVEMODE_DIRECT = 'X'
* KEEP = ' '
* LOCAL_CAT = ' '
* IMPORTING
* COMMIT_COUNT =
* TABLES
* T_OBJECT =
* T_NAME =
* T_ID =
* T_LANGUAGE =
.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'GRUN'
LANGUAGE = SY-LANGU
NAME = L_NAME
OBJECT = 'MATERIAL'
TABLES
LINES = IT_LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
CASE SY-SUBRC.
WHEN '4'.
* MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
WHEN OTHERS.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDCASE.
‎2012 Feb 14 10:31 AM
‎2012 Feb 15 6:45 AM
Hi,
After calling the COMMIT_TEXT FM, try using the below statement before calling READ_TEXT FM.
WAIT UP TO 5 SECONDS.
You may also try by changing the seconds value greater than 5 also. Please don't give any big value for seconds because it may cause the program to hang.
‎2012 Feb 15 11:45 AM
Thanks guys, issue solved by giving wait command.
Points rewarded !!!!