This website is not affiliated with, sponsored by, or approved by SAP AG.

SAPscript print text created w/text control? Split II

Development SAPscript/ Smartforms

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

SAPscript print text created w/text control? Split II

Postby nrogers » Mon Dec 07, 2009 10:05 am

Hello norinori1,

I know it's a long time since you posted this message but I hope you can help.

I'm having exactly the same problem you had. I discovered the CONVERT_STREAM_TO_ITF_TEXT function but I'm having a lot of difficulty with it. Would you possibly have an example of the code you used to achieve your result (including data declarations if possible)?

Thanks in advance.

Regards,
Noel.

[moderator message/fish]: The OP came from this topic.
nrogers
 
Posts: 31
Joined: Wed Feb 04, 2004 7:01 am

Re: Can SAPscript print text that were created w/ text control?

Postby BradB » Tue Dec 08, 2009 6:51 am

What exactly are you having trouble with? Perhaps you should post your code that doesn't work? There are only two tables that you need to provide for that function. Did you look at the where-used list?
Ironman Triathlete and SAP Dev/Config Expert
(which is harder?)
BradB
 
Posts: 685
Joined: Wed Mar 22, 2006 10:27 am
Location: Standing right behind you

Re: Can SAPscript print text that were created w/ text control?

Postby nrogers » Tue Dec 08, 2009 10:14 am

Hi BradB,

Thanks for your reply but I've discovered in the meantime that I don't need CONVERT_STREAM_TO_ITF_TEXT after all. I just needed to understand better how Sales Order Item texts are stored in SAP. Looking at this function did help my understanding.

Basically my program was inserting the <CR><LF> characters in the expectation that this would cause a line break when the eventual invoice was printed. What I needed to do was just enter each line of my text as a separate row in the item text table (defined by BAPISDTEXT) with format_col = '*' being the vital component that forced the eventual line breaks needed.

Thanks again,
Noel.
08-Dec-2009
nrogers
 
Posts: 31
Joined: Wed Feb 04, 2004 7:01 am

Re: Can SAPscript print text that were created w/ text control?

Postby grunt » Wed Dec 09, 2009 6:44 am

Hi Folks,

I'm doing a BAPI_SALESORDER_CREATEFROMDAT2 and need some help with the TEXT on HEADER>TEXTS tab. I have code as follows:

perform build_order_text_table tables gt_bapitext using:
'S001' gt_tabxml-lastname,
'S002' gt_tabxml-firstname,
'S003' gt_tabxml-BRANCH,
'S004' gt_tabxml-BILLINGADDRESS1,
'S005' gt_tabxml-BILLINGADDRESS2,
'S006' gt_tabxml-BILLINGADDRESS3,
'S007' gt_tabxml-BILLINGCITY,
'S008' gt_tabxml-BILLINGPROVINCE,
'S009' gt_tabxml-BILLINGPOSTALCODE,
'S010' gt_tabxml-BILLINGCOUNTRY.


FORM build_order_text_table TABLES P_TEXT STRUCTURE BAPISDTEXT
USING VALUE(P_textid)
P_TEXTLINE.

data: l_langu type sy-langu value 'E'.
data: l_languiso type char2 value 'EN'.
data: l_docno type ebeln value space.
data: l_itemno(6) type n value '0'.
data: l_formatcol(1) type c value space.
data: l_function(1) type c value space.

*load textlines
p_text-doc_number = l_docno.
p_text-ITM_NUMBER = l_itemno.
p_text-TEXT_ID = p_textid.
p_text-LANGU = l_langu.
p_text-LANGU_ISO = l_languiso.
p_text-FORMAT_COL = l_formatcol.
p_text-TEXT_LINE = p_textline.
p_text-FUNCTION = l_function.

append p_text.

ENDFORM. " build_order_text_table

This does not work, since I never see any text in the HEADER>TEXTS screen after I run the BAPI.

What am I doing wrong?? What am I missing??. Do I need to register any text-related stuff anywhere??

Thanks heaps,
Gunter
grunt
 
Posts: 3
Joined: Wed Dec 09, 2009 6:25 am

Re: Can SAPscript print text that were created w/ text control?

Postby nrogers » Wed Dec 09, 2009 8:24 am

Hi Gunter,

This is all I did to populate my header text:

my_order_text-text_id = '0001'.
my_order_text-langu = sy-langu.
my_order_text-format_col = '*'.
my_order_text-text_line = 'This is my text'.
APPEND my_order_text.

I didn't specify a doc_number or function or anything else as you did.
Also I do an UNPACK on the itm_number when populating it so:

UNPACK l_itemno TO p_text-ITM_NUMBER.


Did you look into your p_text table in debugging?

I hope this helps.
Regards,
Noel.
09-Dec-2009
nrogers
 
Posts: 31
Joined: Wed Feb 04, 2004 7:01 am

Re: Can SAPscript print text that were created w/ text control?

Postby grunt » Wed Dec 09, 2009 2:42 pm

Thanks, Noel

It doesn't seem to do anything. Still dont see anything in HEADER>TEXTS

Does Config enter this scenario, I wonder. I'll check with the funtional guys.

Cheers,
Gunter
grunt
 
Posts: 3
Joined: Wed Dec 09, 2009 6:25 am

Re: Can SAPscript print text that were created w/ text control?

Postby Gothmog » Thu Dec 10, 2009 1:59 am

Do you always leave format_col empty, as it seems ?
Try with '*' for each new line in a text.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1942
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Can SAPscript print text that were created w/ text control?

Postby grunt » Thu Dec 10, 2009 9:04 am

Hi Noel, Gothmog


This is working now. Thanks for your help.
Regards,
Gunter.

Here is the code:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
FORM build_order_text_table TABLES P_TEXT STRUCTURE BAPISDTEXT
USING VALUE(P_textid)
P_TEXTLINE.

data: l_langu type sy-langu value 'E'.
data: l_languiso type char2 value 'EN'.
data: l_docno type ebeln value space.
data: l_itemno(6) type n value '0'.
data: l_formatcol(1) type c value '*'.
data: l_function(1) type c value space.

*load textlines
p_text-TEXT_ID = p_textid.
p_text-LANGU = l_langu.
p_text-FORMAT_COL = l_formatcol.
p_text-TEXT_LINE = p_textline.

append p_text.

ENDFORM. " build_order_text_table
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
grunt
 
Posts: 3
Joined: Wed Dec 09, 2009 6:25 am


Return to SAPscript/Smartforms

Who is online

Users browsing this forum: No registered users and 4 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.