Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Code not working.........

Former Member
0 Likes
845

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

7 REPLIES 7
Read only

Former Member
0 Likes
818

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.

Read only

0 Likes
818

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.

Read only

Former Member
0 Likes
818

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

Read only

Former Member
0 Likes
818

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.

Read only

Former Member
0 Likes
818

Hi,

check your p_num declaration in perform....

change p_num of type TDLINE and try

regards

padma

Read only

0 Likes
818

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

Read only

Former Member
0 Likes
818

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