Help required. How to print Header Text in customized PO ?
Hi experts,
Please help me go forward with this.
I'm using a ZMEDRUCK & standard printing program.
I have put my code here. Pls go through it and help me what has to be corrected here.
PROGRAM ZMEDRUCK_SUBP2.
FORM fetch_table_data TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
TABLES EKKO.
DATA: BEGIN OF header OCCURS 0,
ld_txt1(163),
ld_txt2(163),
ld_txt3(163),
END OF header.
DATA: li_lines LIKE STANDARD TABLE OF tline WITH HEADER LINE,
ID like THEAD-TDID,
TNAME LIKE THEAD-TDNAME,
TDOBJECT like THEAD-TDOBJECT.
DATA HTEXT LIKE EKKO-EBELN.
DATA f_lines TYPE P.
* HTEXT = EKKO-EBELN.
READ TABLE in_tab WITH KEY EKKO-EBELN.
if sy-subrc = 0.
TNAME = in_tab-value.
ENDIF.
*TNAME = EKKO-EBELN.
*CONCATENATE EKPO-ebeln EKPO-ebelp INTO v_item_text.
*MOVE v_head_text to HNAME.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = TNAME
IMPORTING
OUTPUT = TNAME
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
id = 'F01'
language = 'E'
name = TNAME
object = 'EKKO'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER = TNAME
tables
lines = li_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.
READ TABLE li_lines INDEX 1.
IF sy-subrc = 0.
header-ld_txt1 = li_lines-tdline.
ENDIF.
DESCRIBE TABLE li_lines LINES f_lines.
data: lstr type String,
lstr1 type string,
lstr2 type string,
lstr3 type string,
lstr4 type string.
read table li_lines index 1.
lstr = li_lines.
condense lstr.
clear li_lines.
read table li_lines index 2.
lstr1 = li_lines.
condense lstr.
clear li_lines.
read table li_lines index 3.
lstr2 = li_lines.
condense lstr.
clear li_lines.
if f_lines GT 3.
read table li_lines index 4.
lstr3 = li_lines.
condense lstr.
clear li_lines.
read table li_lines index 5.
lstr4 = li_lines.
condense lstr.
clear li_lines.
endif.
DATA: v_text type text.
CONCATENATE lstr1 lstr2 lstr3 lstr4 into v_text separated by ' '.
CLEAR out_tab.
READ TABLE out_tab WITH KEY name = 'TNAME'.
out_tab-value = v_text.
MODIFY out_tab INDEX sy-tabix.
ENDFORM.
And my script is :
/:PERFORM FETCH_TABLE_DATA IN PROGRAM ZMEDRUCK_SUBP2
/:USING &EKKO-EBELN&
/:CHANGING &TNAME&
/: ENDPERFORM
IL RECEIVED FROM M/S &TNAME&
Hi,
Use this Function module 'READ_TEXT'
T_lines contains the header text, you can loop it and display it in sap script
Function module to read the header text
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = 'F01'
language = sy-langu
name = ekko-ebeln
object = ekko
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.
Regards
Krishna
Similar Messages
-
How to Print Header text in PO SAPScript
Hi Gurus,
I am working on PO Script (MEDRUCK). I copied the Standard to a Z form. ZMM_MEDRUCK, Now I need to print the the Header text at the end of MAIN window. I created a a perform and call it from the Script and read the heder text by using FM Read_text
DEFINE &TEXT1& = ' '
PERFORM GET_TERMS IN PROGRAM ZMM_MEDRUCK_ROUTINE
USING &EKKO-EBELN&
CHANGING &TEXT1&
ENDPERFORM
PROTECT
&TEXT1&
ENDPROTECT
but while returning I am getting only one line. Can any body suggest me how I can read the Header text in PO script. Please provide the sample Code.
Regards
SonyHi,
Use this Function module 'READ_TEXT'
T_lines contains the header text, you can loop it and display it in sap script
Function module to read the header text
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = 'F01'
language = sy-langu
name = ekko-ebeln
object = ekko
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.
Regards
Krishna -
How to use Read_text in Smart Forms for printing Header Texts
Dear ALL,
I want to print Header Texts in SmartForms, For that
I am using T/Code VL02N .. and choosed Header ..
got this details... from Text Header.
Text Name :0080000441
Language :EN
Text ID :Z002
Text Object :VBBK.
So in Smart forms Under Template i have created a text and Program Code .
Inside that I have used this below code .
CALL FUNCTION 'READ_TEXT'
EXPORTING
*CLIENT= SY-MANDT
ID = 'Z002'
LANGUAGE = SY-LANGU
NAME = NAME
OBJECT = 'VBBK'
TABLES
LINES = IT_TLINE
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.
CLEAR IT_TLINE.
ENDIF.
Kindly suggest me, Where to declare the variables and loops for using this Read_Text Syntax in Smartforms .
Response to this will be highly appreciated........
Regards ,
Vinoth.hi
good
please check this code
CONSTANTS:
*For text reading like in LCNMMFTX / FORM SET_CONTROL_TEXT
text_id like thead-tdid value 'MATK',
text_obj like thead-tdobject value 'AUFK '.
data tlines like tline occurs 0 with header line.
data tdname like thead-tdname.
data tdheader like thead.
if not it_proj-ltxsp is initial.
refresh tlines.
tdname = sy-mandt.
tdname+3 = it_proj-rsnum.
tdname+13 = it_proj-rspos.
tdname+17 = it_proj-rsart.
call function 'READ_TEXT'
exporting
id = text_id
language = it_proj-ltxsp
name = tdname
object = text_obj
importing
header = tdheader
tables
lines = tlines.
exceptions
not_found = 01.
thanks
mrutyun^ -
hi,
when i went through smart form code ,i found the following code for printing texts for items(me23n-->item--
>texts)
in TEXT node in smartform (for printing item text):
TYPE: INCLUDE TEXT
TEXT NAME : &G_TEXT_KEY&
TEXT OBJECT: EKPO
TEXT ID: F01
LANGUAGE: &SY-LANGU&
How to create text name,text object,text id?
when i gave text name & text id in SO10 &then display it's giving message Text Id F01 for Text Object TEXT does not exist.
how to create text object EKPO instead of TEXT.where can i see this TEXT OBJECT option.
how can i print header texts in ME23N?
please help?hi mustafa,
1. If you want to create text name, text object, text id.. you have to create functionally in spro settings....
spro
> mm
> purchasing
> messages
> texts for messages
> define texts for purchase order
here you can define header texts or item text functionally
If you want to create in you po then go to header text tab and create with respective text
2. if you want to print header texts simply pass only
po number in text_name,
text_object : ekko
text_id : depends up on ur text check i header text tab
language key u know as usual
Don't forget to reward points
praveen -
Adobe Forms: Printing Header Text - Background as Dark
Hi,
We are upgrading our ECC system to Enahncement Pack 5.
We have Adobe forms for Sales Order, Delivery Notes,... In Border Palatte, we have set 'Solid' as a background fill for our header texts
After applying patches, Adobe forms started printing header texts background very Dark.We are not able to read the texts. If I view the document in the spool then they are displayed correctly. If I save spool document on the desktop and print it then also output is printed as we want. Only when we print it directly through VA01, VA02 ( directly from SAP ) then it gives this error.
I removed the background fill then it prints text correctly but then I loose the separation between header and content.
I will appreciate any help in this regard
Jitendra Pongurlekar
Moderator message: wrong forum, please have a look in the forum for "Adobe Interactive Forms".
Edited by: Thomas Zloch on Mar 4, 2011 10:55 AMHi mrudul,
as usual in programming, you got different ways to solve the problem. So if you work through the content here on SCN you will find a lot of examples how to decide between different letter heads. The easiest solution (and might be the best) is to pass the necessary data via the interface and do not add any condition in the form itself.
How to create a dynamic field and all the stuff is very basic knowledge, so I think you do not need any explaination how to do that. If so I refer you to the official documentation provided by SAP.
If you have some minutes please work through this blog Before You Ask - Just another guide and phrases like "urgent" or "do reply" are just not necessary to get an answer
~Florian -
How to print long text in scripts
plzzzzzzzzz answer this qestion
how to print long text in scriptsHi Kranthi,
You can create Text Id and include that in your script.
For example:
/E TEXT
/: INCLUDE ZTEXT OBJECT TEXT ID ST
Hope this helps.
Please reward if useful.
Thanks,
Srinivasa -
How to print the text in only last but one page in sapscripts
hiiiiiiiiiii,
explian how to print the text in only last but one page in sapscripts? wher to write the code? plz if possible explain in detail with an example?Hello,
The total no pages is given by &SAPSCRIPT-FORMPAGES& command.
So u can handle the situation in ur form like this
/: if &PAGE& = &SAPSCRIPT-FORMPAGES&
p1 TEXT
/: endif
Try in this way it may help u.
Regards -
How to print Arabic text along with the English in smartform ( ECC6 version
Hi All,
our is ECC6 version, Non unicode, ABAP stack ( not dual stack )
is it possible to print in Arabic language in the above version ?
if yes, then please let me know how to print Arabic text and English text in the same smartfrom.
i tried in the following procedures :
1) i created standard text (SO10) in arabic language.
i called in the smartform ( include text - i )
langage AR
but system throws error message saying, required language is not installed.
2) if i use READ_TEXT function module.
text getting printed in diff format but not in arabic.
waiting for your replies..ECC6 and Non-Unicode? I think you'll need multiple code pages, I doubt there's a mixed Arabic/Latin1 available. And I don't think SAP supports new MDMP systems any more. If you need to support multiple languages you really need to go Unicode. It's probably easier to do the Unicode conversion than to try to support multiple code pages and you have to make the switch eventually.
-
How to restrict header text changes in sales order level
Dear Experts,
how to restrict header text changes in sales order level change mode
thanksHello Chandu,
how to restrict header text changes in sales order level change mode
In order to restrict changes to Sales Order Header Text, the appropriate User Exit would be USEREXIT_MOVE_FIELD_TO_TVCOM_H. With the help of ABAPer, you can include the simple logic on the basis of Header Text type such that whenever any changes are incurred on the Sales Order header text, updates would be prevented.
Please try out this approach and let us know your latest observation on this issue.
Regards,
Sarthak -
How to print header in first and last page only in SAPSCRIPT
Hi!
How to print header in first and last page only in SAPSCRIPT,
in between pages, I need to print all line items in MAIN window only .
Thanks in anticipation!
Aki.Hi All,
Thanks for your early update...but my requirement here is
I have two pages (FIRST , NEXT ) First is having Header, Main and Footer
NEXT is having Main and Footer ..I am printing PO here..let us think that my PO is having 20lines items , let us assume that it takes five pages...
Now how application is printing is ..first set of data is printing in FIRST page and remainiang data distributed to 4 pages printing in NEXT page ..but what my requirement is , I need fifth page print on FIRST page, instead of NEXT page... Ultimately I need last set of data always print in FIRST ie out of 5 pages 1st print on FIRST 2nd 3rd 4th print on NEXT and 5th print again on FIRST .
hope you this will clear you.
Thanks! -
How to read header texts in the on save user exit of VA01
Hi Experts,
I have a requirement to read the header texts in the on save user exit.
I have to check whether departmental code in header text is not initial or not.
Can any one please pour in some points of how it can be done......
Thanks in Advance.
PremHi
U can use fm READ_TEXT:
DATA: THEAD LIKE THEAD,
TLINES LIKE STANDARD TABLE OF TLINE WITH HEADER LINE.
THEAD-TDID = <text id>.
THEAD-TDSPRAD = <language>.
THEAD-TDOBJECT = 'VBBK'.
THEAD-TDNAME = VBAK-VBELN.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = THEAD-TDID
LANGUAGE = THEAD-TDSPRAD
NAME = THEAD-TDNAME
OBJECT = THEAD-TDOBJECT
TABLES
LINES = TLINES
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.
U can use it in all situations ( inserting and updating) because that fm returns the buffered text.
Max -
How to read header text from VF03 into smartfrom
Hi all,
i want to print header text from vf03 in smartforms
byeHi,
Tcode VF03 enter Billing Doc no -
>goto header-----> select header texts
When you get the values Textname, text id, textobject to the smartform.
call the FM read_text in the programing lines to get the long text in the internal table. Another way to retrieve the long text is to use INCLUDE but for your requirement is better to uses READ_TEXT function module.
Once you get the data in the internal table.
Create table and loop the long text internal table. Now in the table when create a text node, keep a condition on the text node in the conditions column that when sy-tabix = 3. Which means you are skipping two lines (Administrative data).
Procedure:
1. Right click > create-> programming lines.
2. In the Input parameters pass TEXT NAME, TEXT ID, Text Object and Interanal table(itab) and In output paramaeters the Internal table (itab).
3. call function Read_text and pass the values.
4. create a table for Itab.
5. create a text node.
6. Keep a condition on the text node sy-tabix = 3 in the condition tab of the text node.
7. &itab-line&
<b>Check this link for sample program</b>
long text in smartform
Regards,
Maha -
How to print the text in points wise in sap script
hi friends,
how to print the text in points wise in sap script.
ex: if suppose paragraph consists of 15 lines. then according to one sentence or one fullstop (.) it should give point 1. like that...
1. hai how ru.
2. what r u doing.
3.where r u.
like this i want numbering.. waiting for ur replys.
thanks,
kirandeclare a counter
data : cnt type char 4.
print :
cnt = cnt + 1.
&cnt& &text&
cnt = cnt + 1. and so on.
or.
if the data is in an internal table
loop at internal_table.
cnt = cnt + 1.
write form.
in script -&cnt& &text&
endloop.
Edited by: NIKHILKUMAR POOJARI on Nov 17, 2008 11:18 AM -
How to Print a text in bold format in a classic report ??
How to Print a text in bold format in a classic report ??
hi
u can use
<b>FORMAT INTENSIFIED ON.</b>
regards
ravish
reward if useful -
How to print a text in java?
How to print a text in java?
of corse, i have JTextField in my frame that i want to extract the text and print it on a paper with a printer.
Maybe you are looking for
-
How do I move my files from my PC to the Cloud?
How do I move my files from my PC to the cloud?
-
Has anyone had a problem with viewing the same pdf but it looks different on two computers?
I am plotting a pdf file from a DWG drawing. The pdf file looks fine on my computer. However, when I send it to someone else the lines are not visible and it is hard for them to read. I have tried exporting to pdf and plotting to pdf. The program
-
Can't Change IP properties is greyed, Can't Open IE
Hi all, I've getting a big issue with my application server running windows server 2008 R2. When trying to change IP the TCP/IP properties remains greyed, Can't open Internet Explorer.And can't run some application as they required administrative rig
-
IDoc (asynchron) - HTTP (synchron, plain text) - RFC
Hello, I've implemented the following Business Process inside our PI 7.1: Reciver -> Mapping -> Sender -> Mapping -> Sender (getting IDoc) (IDoc to Plain Text) (sync, HTTP) (plai
-
Read XML with different schema definitions
Hello, I have an XML stored in a table as XMLTYPE and I have no problem to read the first part (ELMAHeader) WITH t AS( SELECT XMLTYPE( q'[<?xml version = '1.0' encoding = 'UTF-8'?> <ELMAKM xsi:noNamespaceSchemaLocation="./KM/01.00/ELMAKM_000001.xsd"