<?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: code for add the cost center description in sapscript ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589793#M23727</link>
    <description>&lt;P&gt;You may get a better answer for you. Because what I suggest could be time consuming. I try to never write my code in a SapScript. I copy the SAP program that call the SAPScript and then make the changes there. If your SAPscript has the same fields as your program, it always works. If it doesn't work it's very easy to debug.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Feb 2018 18:52:07 GMT</pubDate>
    <dc:creator>mmcisme1</dc:creator>
    <dc:date>2018-02-22T18:52:07Z</dc:date>
    <item>
      <title>code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589792#M23726</link>
      <description>&lt;P&gt;Hi every body&lt;/P&gt;
  &lt;P&gt;I wrote this program for read the cost center description from CSKT Table:&lt;/P&gt;
  &lt;P&gt;REPORT ZRED_RES_COSTCENTER.&lt;BR /&gt;FORM get_coster TABLES IN_PAR STRUCTURE ITCSY&lt;BR /&gt; OUT_PAR STRUCTURE ITCSY.&lt;BR /&gt;DATA: Coster TYPE CSKT-LTEXT .&lt;BR /&gt; READ TABLE IN_PAR WITH KEY NAME = 'MSEG-KOSTL'.&lt;BR /&gt; IF SY-SUBRC IS INITIAL.&lt;BR /&gt; READ TABLE OUT_PAR WITH KEY NAME = 'COSTERNAME'.&lt;BR /&gt; IF SY-SUBRC IS INITIAL.&lt;BR /&gt; SELECT SINGLE LTEXT INTO coster FROM CSKT WHERE KOSTL EQ IN_PAR-VALUE .&lt;BR /&gt; OUT_PAR-VALUE = Coster .&lt;BR /&gt; MODIFY OUT_PAR INDEX SY-TABIX.&lt;BR /&gt; ENDIF.&lt;BR /&gt; ENDIF.&lt;BR /&gt;&lt;BR /&gt;ENDFORM.&lt;/P&gt;
  &lt;P&gt; but when I use this program in the sapscript , it dosen't work.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/118349-capture.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;
  &lt;P&gt;cost center in CSKT table like this:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/118347-capture1.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;
  &lt;P&gt;in MSEG table :&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/118348-capture.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;
  &lt;P&gt;can u help me please?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 10:50:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589792#M23726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-02-22T10:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589793#M23727</link>
      <description>&lt;P&gt;You may get a better answer for you. Because what I suggest could be time consuming. I try to never write my code in a SapScript. I copy the SAP program that call the SAPScript and then make the changes there. If your SAPscript has the same fields as your program, it always works. If it doesn't work it's very easy to debug.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 18:52:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589793#M23727</guid>
      <dc:creator>mmcisme1</dc:creator>
      <dc:date>2018-02-22T18:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589794#M23728</link>
      <description>&lt;P&gt;can you please explain a little more? how can I add the cost center description to sapscript from material document (mseg table ) ?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 05:18:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589794#M23728</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-02-23T05:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589795#M23729</link>
      <description>&lt;P&gt;in the MB51 cost center format different with the tables:&lt;/P&gt;
  &lt;P&gt;here cost center XXXXX but in the CSKT like this 00000XXXXX&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/114770-capture.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;when the program read the cost center number which format comes?maybe problem is it. can anyone guide me?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 05:44:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589795#M23729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-02-23T05:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589796#M23730</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;
  &lt;P&gt;I checked your code and if I understand it correctly the description is stored in field &amp;amp;costername&amp;amp;.&lt;/P&gt;
  &lt;P&gt; But instead it the field &amp;amp;costcenter&amp;amp; is displayed in the form. Is it right?&lt;/P&gt;
  &lt;P&gt; Best regards,&lt;/P&gt;
  &lt;P&gt; Hedvig&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 11:31:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589796#M23730</guid>
      <dc:creator>hedvig_rohonyi</dc:creator>
      <dc:date>2018-02-23T11:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589797#M23731</link>
      <description>&lt;P&gt;What happens when the SAPScript runs? Does it give you a short dump?&lt;/P&gt;
  &lt;P&gt;It looks like:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;perform get_coster in program zreadres_costcenter using &amp;amp;mseg-kostl&amp;amp;
                                                   changing &amp;amp;costername&amp;amp;.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Doesn't match your parameters in the form:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;FORM get_coster TABLES IN_PAR STRUCTURE ITCSYOUT_PAR STRUCTURE ITCSY
                       OUT_PAR STRUCTURE ITCSY.
                          &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;So when the code runs is there a short dump? Look at your perform&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;perform get_coster in program zreadres_costcenter TABLES IN_PAR STRUCTURE ITCSYOUT_PAR STRUCTURE ITCSY
                                                         OUT_PAR STRUCTURE ITCSY.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;That should work - I think. Also look at Hedvig's answer. &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2018 13:09:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589797#M23731</guid>
      <dc:creator>mmcisme1</dc:creator>
      <dc:date>2018-02-23T13:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589798#M23732</link>
      <description>&lt;P&gt;no it dosen't display anything&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/117550-capture2.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2018 07:21:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589798#M23732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-02-24T07:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589799#M23733</link>
      <description>&lt;P&gt;when I used the MSEG-KOSTL directly in the main window of form , cost center displayed like this : XXXXX&lt;/P&gt;
  &lt;P&gt;zeros dose not display.but CSKT-LTEXT format is 00000XXXXX&lt;/P&gt;
  &lt;P&gt;I don't know when the read this section of the program "&lt;/P&gt;
  &lt;P&gt;SELECT SINGLE LTEXT INTO coster FROM CSKT WHERE KOSTL EQ IN_PAR-VALUE .&lt;BR /&gt; OUT_PAR-VALUE = Coster ." &lt;/P&gt;
  &lt;P&gt;it's true or not?&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2018 07:37:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589799#M23733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-02-24T07:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589800#M23734</link>
      <description>&lt;P&gt;I don't understand if you're talking about the description of the cost center or about its number.&lt;/P&gt;
  &lt;P&gt;As far as I understand, your question is answered (solved for the description), and you should mark Hedvig's answer as correct.&lt;/P&gt;
  &lt;P&gt;Now your question is about the cost center number? Although it's a continuation for you, it should be posted as a new question in the forum.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2018 09:14:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589800#M23734</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-02-24T09:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589801#M23735</link>
      <description>&lt;P&gt;My question about the cost center description. I give you more information for solve the my problem. In the sapcript form there is the cost center number. I want to display cost center description. I told you maybe formt of cost center number that com from MSEG table diffrent with CSKT then program dosen't work maybe. I didn't say my question about descrption is solved. &lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2018 19:41:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589801#M23735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-02-24T19:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589802#M23736</link>
      <description>&lt;P&gt;Thanks. I understand now. The values of the cost center number are stored with leading zeroes in the database (stored in so-called internal values), but output without these zeroes (external values). So, you should better debug your code to make sure what's going on (in debug you always see the internal value, i.e. with leading zeroes).&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2018 19:56:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589802#M23736</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-02-24T19:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589803#M23737</link>
      <description>&lt;P&gt;hi&lt;/P&gt;
  &lt;P&gt;result of debug: it doesn't display anything.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/120721-photo-2018-03-12-15-13-46.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 11:46:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589803#M23737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-12T11:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589804#M23738</link>
      <description>&lt;P&gt;But what is the value of MSEG-KOSTL, and did you debug the subroutine GET_COSTER? You'll find out what's going on, for sure.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 12:16:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589804#M23738</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-03-12T12:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589805#M23739</link>
      <description>&lt;P&gt;how can i see the MSEG-KOSTL vlaues ?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 12:36:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589805#M23739</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-12T12:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589806#M23740</link>
      <description>&lt;P&gt;The same way as you did for *MKPF-CPUDT&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 15:38:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589806#M23740</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-03-12T15:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589807#M23741</link>
      <description>&lt;P&gt;By the way, I see a trailing dot in the line PERFORM, it shouldn't be there. Maybe the PERFORM fails.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 15:39:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589807#M23741</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-03-12T15:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589808#M23742</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE LTEXT INTO coster FROM CSKT WHERE KOSTL EQ IN_PAR-VALUE .&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Don't use the parameter (here IN_PAR-VALUE) like that in the SAPScript routines, it's a straight path to failure. Declare another variable with the same type as CSKT-KOSTL and use that. Don't forget to call the conversion routine to make sure leading zeroes are added.&lt;/P&gt;
  &lt;P&gt;Also SPRAS and KOKRS should be in SELECT since they're key fields, otherwise you'll be in for an unpleasant surprise down the line.&lt;/P&gt;
  &lt;P&gt;And +1 to Sandra's comments.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 18:51:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589808#M23742</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2018-03-12T18:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589809#M23743</link>
      <description>&lt;P&gt;as you said maybe this path is failure.&lt;/P&gt;
  &lt;P&gt;look at table CSKT : there are two value for cost center description (language EN and FA)&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/122686-2.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 04:59:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589809#M23743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-13T04:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: code for add the cost center description in sapscript ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589810#M23744</link>
      <description>&lt;P&gt;This was not mentioned before. Obviously, with this data you &lt;STRONG&gt;must&lt;/STRONG&gt; use language as well. &lt;/P&gt;
  &lt;P&gt;And this screenshot also clearly shows leading zeroes in the cost center, so that's clearly a problem here. (Thought we've established that already though.)&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 18:58:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-add-the-cost-center-description-in-sapscript/m-p/589810#M23744</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2018-03-13T18:58:27Z</dc:date>
    </item>
  </channel>
</rss>

