‎2008 Jul 09 1:09 PM
Hi,
I have following code.........
In script........
/:DEFINE &P_NUM& = ' '
/:PERFORM ZFORM IN PROGRAM ZSD
/:USING &J_1IEXCDTL-NUM_OF_PKGS&
/:CHANGING &P_NUM&
/:ENDPERFORM
Inside subroutine pool......
FORM ZFORM TABLES IN_TAB STRUCTURE ITCSY OUT_TAB STRUCTURE ITCSY.
TABLES:LIKP,J_1IEXCDTL.
DATA: BEGIN OF TBL_LINES OCCURS 0.
INCLUDE STRUCTURE TLINE.
DATA: END OF TBL_LINES.
DATA:P_NUM LIKE J_1IEXCDTL-NUM_OF_PKGS.
DATA: L_NAME LIKE THEAD-TDNAME.
DATA P_VBELN LIKE LIKP-VBELN.
READ TABLE IN_TAB INDEX 1.
MOVE IN_TAB-VALUE TO P_NUM.
SELECT SINGLE VBELN FROM LIKP INTO P_VBELN. "WHERE VBELN = J_1IEXCDTL-RDOC1.
MOVE P_VBELN TO L_NAME.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'Z015'
LANGUAGE = SY-LANGU
NAME = L_NAME
OBJECT = 'VBBK'
TABLES
LINES = TBL_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 EQ 0.
LOOP AT TBL_LINES.
WRITE TBL_LINES-TDLINE.
IF TBL_LINES-TDLINE NE SPACE.
P_NUM = TBL_LINES-TDLINE.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
READ TABLE OUT_TAB INDEX 1.
MOVE P_NUM TO OUT_TAB-VALUE.
MODIFY OUT_TAB INDEX 1.
ENDFORM. "ZFORM
not working..not getting the long text mainatined in tcode........
Edited by: Hosmath on Jul 9, 2008 2:10 PM
‎2008 Jul 09 1:14 PM
Hi Hosman,
i think u need ro make change in code like below.
SELECT SINGLE VBELN FROM LIKP INTO P_VBELN WHERE VBELN = P_NUM.
‎2008 Jul 09 1:17 PM
hi,
the problem is here SELECT SINGLE VBELN FROM LIKP INTO P_VBELN. "WHERE VBELN = J_1IEXCDTL-RDOC1.
change that to SELECT SINGLE VBELN FROM LIKP INTO workarea WHERE VBELN = P_VBELN.
‎2008 Jul 09 1:23 PM
hello,
u r telling that u have p_num but it holds only 1 char. so try to convert that p_num to no. of chars u want.
EX : define &p_num(100)&= ' '.
and also put a breakpoint in subroutine pool and then execute see whether TBL_LINES-TDLINE has value and when u r assigning that value to p_num whether that is holding value or not.
i think in this u will get some idea.
Rgds.,
subash
‎2008 Jul 09 1:39 PM
What is your sy-subrc after your Call Function READ_TEXT? From your Select Statement it appears you are grabbing the first record only from LIKP, as your WHERE statement is commented out. Are you sure this first record has Text?
SELECT SINGLE VBELN FROM LIKP INTO P_VBELN. "WHERE VBELN = J_1IEXCDTL-RDOC1.
‎2008 Jul 09 1:41 PM
Hi,
check your p_num declaration in perform....
change p_num of type TDLINE and try
regards
padma
‎2008 Jul 09 1:53 PM
Hi,
Actually,I'm running a tcode J1IA103 in which Reference Document No(RDOC1) is same as the delivery no (LIKP-VBELN).Based on this delivery no,I have to display the long text maintained in the VL02N.
But when I'm running the tcode(J1IA103),long text is not seen on print preview.......
Also,I tried to debug the subroutine pool,cursor is not entering the FM READ_TEXT......
Kindly suggest
‎2008 Jul 09 2:02 PM
hi,
r u able to debug the subroutine pool, if so is it not entering into read_text FM . if so, see the sy-subrc value .
for read_text FM u have to pass tdname, tdobject , tdlangu and tdid. u can find these paramters in VL02 transaction there under longtext u can find them. pass those parameters correctly. and also p_num with some length so that it can store value..
check these things..
Rgds.,
subash