on 04-28-2009 5:47 AM
dear all,
I have developed a report and script for purchse order priting in potrait size format.Now i was getting some problem in script.all are coming properly but in the print out i need the text under the meterial description.But i was getting from sarting line means from field one i.e, serial no.
My first line coming properly.Next line text should start from material description position.
my script code is like this :
/E ELE
IN &IT_EKPO-CNT&,,&IT_EKPO-MATNR&,,&SPACE(3)&&IT_EKPO-TXZ01+0(30)&,,
= &IT_EKPO-QVAL&,,&IT_EKPO-NETPR&,,&IT_EKPO-DVAL&,,
= &SPACE(9)&&IT_EKPO-TOT&
/: IF &IT_EKPO-TXZ01+31(40)& NE ' '
IN ,,,,,,&IT_EKPO-TXZ01+31(40)&
/: ENDIF
/: INCLUDE &M_PO& OBJECT EKPO ID F01 LANGUAGE &EKPO-SPRAS&
if i put space before include , output is not cmng(text is not displaying).but text should start form material description.I will take the print on pre-print format only.
Edited by: sree thaduka on Apr 28, 2009 6:47 AM
Edited by: sree thaduka on Apr 28, 2009 6:53 AM
Hi,
i think u r printing the item level text by using below statement..
/: INCLUDE &M_PO& OBJECT EKPO ID F01 LANGUAGE &EKPO-SPRAS&
instead of calling directly in script, better get the text from DRIVER PROGRAM using READ_TEXT Function Module and then pass this text lines to Script using WRITE_FORM Function Module..
then assign the paragraph format to this lines in script...
eg:
data : p_name(40).
use conversion routine for ekpo-posnr before concatenating..
concatenate ekpo-ebeln ekpo-posnr into p_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = p_spras
name = p_name
object = 'EKPO'
TABLES
lines = t_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6.
now u call the below FM & call the ELEMENT in script and print the text...
call function 'WRITE_FORM'
EXPORTING
element = elementn
EXCEPTIONS
others = 01.
Regds,
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HERE MY CODE :
DATA : T_LINE occurs 0 with header line.
data : p_spras like STXH-tdspras.
p_spras = 'EN'.
data : pname(40).
loop at it_ekpo.
concatenate it_ekpo-ebeln it_ekpo-ebelp into PNAME.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'F01'
LANGUAGE = p_spras "IT_EKPO-SPRAS
NAME = PNAME
OBJECT = 'EKPO'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = t_line
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.
endloop.
/: INCLUDE &M_PO& OBJECT EKPO ID F01 LANGUAGE &EKPO-SPRAS&
instead of calling directly in script, better get the text from DRIVER PROGRAM using READ_TEXT Function Module and then pass this text lines to Script using WRITE_FORM Function Module..
then assign the paragraph format to this lines in script...
eg:
DATA: BEGIN OF t_lines OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF t_lines.
data : p_name(40).
call the READ_TEXT in the LOOP of ur material table which should contain the EBELN & EBELP..
LOOP AT it_final.
use conversion routine for ekpo-posnr before concatenating..
concatenate it_final-ebeln it_final-posnr into p_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = p_spras
name = p_name
object = 'EKPO'
TABLES
lines = t_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6.
Table t_lines will have the text which u need.
use READ to get the text...
READ t_lines index 1.
now u call the below FM & call the ELEMENT in script and print the text...this ELEMENT in write_form should be called exactly after u printing the Material Description
call function 'WRITE_FORM'
EXPORTING
element = elementn
EXCEPTIONS
others = 01.
ENDLOOP.
U call element 'elementn' in the form.
Try to use WHERE USED LIST for FM READ_TEXT in SE37, u ill come to know about how to use the FM..
Declartions with TYPE is very important, otherwise it will go DUMP..
Regds,
Pavan
Hello sir,
I was facing one more problem. Iam getting the text prperly but in case of text in two lines ima getting only first line text.i tries all ways but i was getting only single line.here is my code:
loop at it_ekpo.
concatenate it_ekpo-ebeln it_ekpo-ebelp into p_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = p_spras
name = p_name
object = 'EKPO'
TABLES
lines = t_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6.
ENDIF.
READ TABLE T_LINES INDEX 1.
endloop.
in me23n my text is like this :
loop at it_ekpo.
concatenate it_ekpo-ebeln it_ekpo-ebelp into p_name.
'Unbrako make-TEXT DUMMAY DATA IN DEV CHANGED BY ABAP1 AND TESTED IN DEV
FOR 1ST ITEM'.
I was getting only frist line i.e.,
''Unbrako make-TEXT DUMMAY DATA IN DEV CHANGED BY ABAP1 AND TESTED IN DEV "
Iam not getting second line 'FOR 1ST ITEM'.
Also there may be a chance to have more than 2 or 3 lines.
so please help me.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.