<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Available Data in printprograms in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948779#M64804</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes lars, you can do it calling a program from your SAPScript. Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SapScript&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;CUST&amp;amp; = '00000021'.&lt;/P&gt;&lt;P&gt;/:PERFORM GET_NAME IN PROGRAM ZTEST&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;CUST&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;NAME&amp;amp;&lt;/P&gt;&lt;P&gt;/:ENDPERFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZTEST&lt;/P&gt;&lt;P&gt;TABLES scustom.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_name tables in_tab structure itcsy out_tab structure itcsy.&lt;/P&gt;&lt;P&gt;  read table in_tab index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select single * from scustom&lt;/P&gt;&lt;P&gt;    where id = in_tab-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    read table out_tab index 1.&lt;/P&gt;&lt;P&gt;    move scustom-name to out_tab-value.&lt;/P&gt;&lt;P&gt;    modify out_tab index sy-tabix.&lt;/P&gt;&lt;P&gt; else.&lt;/P&gt;&lt;P&gt;   read table out_tab index 1.&lt;/P&gt;&lt;P&gt;   move 'No name' to out_tab-value.&lt;/P&gt;&lt;P&gt;   modify out_tab index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.............&lt;/P&gt;&lt;P&gt;But there should be a field in your print program which can be used to fetch the data from a different table which is not defined in your print program.&lt;/P&gt;&lt;P&gt;Hope this is helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Sep 2005 18:07:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-09-21T18:07:30Z</dc:date>
    <item>
      <title>Available Data in printprograms</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948777#M64802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a ABAP print programm. In this program the sapscript-form ist capable of reading the data of the table SADR (Addressdata). But this table is not defined in the print program. Can I also read data which is not directly declared in the printprogram, for example from the calling program? How can I identify the data, that I can read when it is not defind in the printprogramm? Thanks.&lt;/P&gt;&lt;P&gt;Regards, Lars.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2005 17:58:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948777#M64802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-21T17:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Available Data in printprograms</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948778#M64803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The values in which you want to print in the SAPScript form must be global variables of the print program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can, however, use a PERFORM statement inside the SAPscript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You define fields in a SAPSCRipt using DEFINE.  Then you call a FORM in Program.  The the form you get the data and pass it back thru the FORM interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2005 18:03:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948778#M64803</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-09-21T18:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Available Data in printprograms</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948779#M64804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes lars, you can do it calling a program from your SAPScript. Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SapScript&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;CUST&amp;amp; = '00000021'.&lt;/P&gt;&lt;P&gt;/:PERFORM GET_NAME IN PROGRAM ZTEST&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;CUST&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;NAME&amp;amp;&lt;/P&gt;&lt;P&gt;/:ENDPERFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZTEST&lt;/P&gt;&lt;P&gt;TABLES scustom.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_name tables in_tab structure itcsy out_tab structure itcsy.&lt;/P&gt;&lt;P&gt;  read table in_tab index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select single * from scustom&lt;/P&gt;&lt;P&gt;    where id = in_tab-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    read table out_tab index 1.&lt;/P&gt;&lt;P&gt;    move scustom-name to out_tab-value.&lt;/P&gt;&lt;P&gt;    modify out_tab index sy-tabix.&lt;/P&gt;&lt;P&gt; else.&lt;/P&gt;&lt;P&gt;   read table out_tab index 1.&lt;/P&gt;&lt;P&gt;   move 'No name' to out_tab-value.&lt;/P&gt;&lt;P&gt;   modify out_tab index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.............&lt;/P&gt;&lt;P&gt;But there should be a field in your print program which can be used to fetch the data from a different table which is not defined in your print program.&lt;/P&gt;&lt;P&gt;Hope this is helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2005 18:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948779#M64804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-21T18:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Available Data in printprograms</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948780#M64805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I identify the data, that I can read when it is not defind in the printprogramm?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAPSCRIPT will not show an error ( while activating ) even if the data used in it is not in Print Program. However you may not see the data when you print. While printing also you may not encounter an error ( such as data not defined ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check for data being used but not defined in main program with FORM -&amp;gt; CHECK TEXT ( Male sure Symbol Chk is turned on here ). Any undefined data you will see an error here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart for program data , system symbols , sapscript symbols can be used directly in sapscript . No need to define them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2005 18:12:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948780#M64805</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-21T18:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Available Data in printprograms</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948781#M64806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example of a sapscript doing a perform.  It is sending the sales order number and getting the telephone number of the partner back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sapscript code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DEFINE &amp;amp;TEL_NUMBER&amp;amp; = &amp;amp;SPACE&amp;amp;
PERFORM 'TELEPHONE' IN PROGRAM 'ZCUSTOM_PROGRAM'       
USING &amp;amp;VBELN&amp;amp;.                                 
CHANGING &amp;amp;TEL_NUMBER&amp;amp;                             
ENDPERFORM&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;                                           &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP Program code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM TELEPHONE     TABLES CO_SYM_USING   STRUCTURE ITCSY
                          CO_SET_SYMBOLS STRUCTURE ITCSY.

  CLEAR: WK_VBELN,
         TEL_NUMBER.

  READ TABLE CO_SYM_USING WITH KEY NAME = 'VBELN'.
  CHECK SY-SUBRC EQ 0.

  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
       EXPORTING
            INPUT  = CO_SYM_USING-VALUE
       IMPORTING
            OUTPUT = WK_VBELN
       EXCEPTIONS
            OTHERS = 1.
  CHECK SY-SUBRC EQ 0.


*Sales Document: Partner
data: xvbpa
  SELECT SINGLE FROM VBPA
         INTO xvbpa
               WHERE VBELN = WK_VBELN
                 AND POSNR = '000000'
                 AND PARVW = 'WE'.
*Addresses (central address admin.)
  SELECT SINGLE TEL_NUMBER  FROM ADRC
         INTO (TEL_NUMBER)
         WHERE ADDRNUMBER = xvbpa-adrnr. 



*  transfer variable &amp;amp;TEL_NUMBER&amp;amp;
  READ TABLE CO_SET_SYMBOLS INDEX 1.
  CO_SET_SYMBOLS-VALUE = TEL_NUMBER.
  MODIFY CO_SET_SYMBOLS INDEX 1.

ENDFORM. "TELEPHONE&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2005 18:14:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/available-data-in-printprograms/m-p/948781#M64806</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-09-21T18:14:32Z</dc:date>
    </item>
  </channel>
</rss>

