KOSTL in PO (SapScript)

Hi ,
I want to print for each item service purchase order information about cost center.
In transaction ME23N we saw this in detail area.
Question is, where I can find it and if it is from ML_ESLL structure wchich field is it ...
Thanks in advance.
DAD

Hi,
Can you pls elaborate your requirement.
Pls check these tables-
ESLH Service Package Header Data
ESLL Service Package Item Data
Reply if you have more issues.
Reward if helpful.
Best Wishes,
Chandralekha

Similar Messages

  • Routine in sapscript

    Hi all,
    i have a problem when i want display all the costs center in a purchaseOrder by position  each position can have 1,2 or 3 cost center and into the form I have to display this.
    my code is:
    types : begin of ty_centro,
              kostl type ekkn-kostl ,
              sakto type  ekkn-sakto,
        end of ty_centro.
      data: t_centro type standard table of ty_centro,
      wa_centro type ty_centro.
      select kostl sakto into table t_centro
             from ekkn
             where ebeln = w1_ebeln
               and ebelp = w1_ebelp.
      if w_knttp = 'K'.
       MOVE EKKN-KOSTL TO W_KOSTL.
       SHIFT W_KOSTL LEFT DELETING LEADING '0'.
    Loop at t_centro into wa_centro.
        move wa_centro-kostl to w_kostl.
        shift w_kostl left deleting leading '0'.
        move w_kostl to w_ematn.
        move wa_centro-sakto to w_sakto.
        shift w_sakto left deleting leading '0'.
        move w_sakto to w_sakto.
        out_par-name = 'W_EMATN'.
        out_par-value = w_ematn.
        condense out_par-value.
        append out_par. " index sy-tabix.
       read table out_par with key name = 'W_SAKTO'.
        out_par-name = 'W_SAKTO'.
        out_par-value = w_sakto.
        condense out_par-value.
        append out_par. "index sy-tabix.
    endloop.
    but in  the sapscript only display one cost center.
    some body could suggest me something? please
    thanks.
    regards.
    MArisol.

    Hi
    see the sample sub routines and do accordingly
    How to call a subroutine form SAPscripts
    The Form :
    /:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
    /:USING &EKKO-EBELN&
    /:CHANGING &CDECENT&
    /:ENDPERFORM
    The report :
    REPORT zkrpmm_perform_z1medruck .
    DATA : BEGIN OF it_input_table OCCURS 10.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_input_table.
    déclaration de la table output_table contenant les
    variables exportées
    DATA : BEGIN OF it_output_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_output_table.
    DATA : w_ebeln LIKE ekko-ebeln,
    w_vbeln LIKE vbak-vbeln,
    w_zcdffa LIKE vbak-zcdffa.
    FORM CDE_CENT
    FORM cde_cent TABLES input output.
    it_input_table[] = input[].
    it_output_table[] = output[].
    READ TABLE it_input_table INDEX 1.
    MOVE it_input_table-value TO w_ebeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = w_ebeln
    IMPORTING
    output = w_ebeln.
    SELECT SINGLE zcdffa FROM ekko
    INTO w_zcdffa
    WHERE ebeln = w_ebeln.
    it_output_table-name = 'CDECENT'.
    MOVE w_zcdffa TO it_output_table-value.
    MODIFY it_output_table INDEX 1.
    output[] = it_output_table[].
    ENDFORM.
    /: PERFORM
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
    Example:
    In script form
    /: PERFORM READ_TEXTS IN PROGRAM 'Z08M1_FORM_EKFORM1'
    /: USING &EKKO-EKORG&
    /: USING &EKPO-WERKS&
    /: USING &EKKO-EKGRP&
    /: USING &EKKO-BSTYP&
    /: CHANGING &COMPNAME&
    /: CHANGING &SENDADR&
    /: CHANGING &INVCADR&
    /: CHANGING &COMPADR&
    /: CHANGING &COVERLTR&
    /: CHANGING &SHIPADR&
    /: CHANGING &REMINDER&
    /: CHANGING &REJECTION&
    /: CHANGING &POSTADR&
    /: CHANGING &LOGO&
    /: ENDPERFORM
    In program
    FORM Read_texts - To extract the standard texts from the table *
    FORM READ_TEXTS TABLES IN_PAR STRUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA : L_EKORG TYPE EKORG,
    L_WERKS TYPE WERKS_D,
    L_BSTYP TYPE BSTYP,
    L_EKGRP TYPE BKGRP.
    READ TABLE IN_PAR WITH KEY 'EKKO-EKORG' .
    CHECK SY-SUBRC = 0.
    L_EKORG = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY 'EKPO-WERKS' .
    CHECK SY-SUBRC = 0.
    L_WERKS = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY 'EKKO-EKGRP' .
    CHECK SY-SUBRC = 0.
    L_EKGRP = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY 'EKKO-BSTYP' .
    CHECK SY-SUBRC = 0.
    L_BSTYP = IN_PAR-VALUE.
    CLEAR Z08M1_ORG_TEXTS.
    SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG
    AND WERKS = L_WERKS
    AND EKGRP = L_EKGRP
    AND BSTYP = L_BSTYP.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG
    AND WERKS = L_WERKS
    AND EKGRP = L_EKGRP
    AND BSTYP = SPACE.
    ENDIF.
    READ TABLE OUT_PAR WITH KEY 'COMPNAME'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COMP.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'SENDADR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_ADRS.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'INVCADR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_INVC.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'COMPADR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_CPAD.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'COVERLTR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COVR.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'SHIPADR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_SHIP.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'REMINDER'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RMDR.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'REJECTION'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RJCT.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'POSTADR'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_POST.
    MODIFY OUT_PAR INDEX SY-TABIX.
    READ TABLE OUT_PAR WITH KEY 'LOGO'.
    OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_LOGO.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    REPORT ZMPO1 .
    form get_freight tables in_par structure itcsy out_par structure itcsy.
    tables: ekko,konv,t685t.
    data: begin of itab occurs 0,
             ebeln like ekko-ebeln,
             knumv like ekko-knumv,
           end of itab.
    data: begin of itab1 occurs 0,
             knumv like konv-knumv,
             kposn like konv-kposn,
             kschl like konv-kschl,
             kbetr like konv-kbetr,
             waers like konv-waers,
             kwert like konv-kwert,
           end of itab1.
    data: begin of iout occurs 0,
             kschl like konv-kschl,
             vtext like t685t-vtext,
             kbetr like konv-kbetr,
             kwert like konv-kwert,
           end of iout.
    data v_po like ekko-ebeln.
    read table in_par with key 'EKKO-EBELN'.
    if sy-subrc = 0.
       v_po = in_par-value.
       select
         ebeln
         knumv
      from ekko
      into table itab
      where ebeln = v_po.
      if sy-subrc = 0.
        loop at itab.
          select
            knumv
            kposn
            kschl
            kbetr
            waers
            kwert
          into table itab1
          from konv
          where knumv = itab-knumv and
                kappl = 'M'.
        endloop.
        loop at itab1.
          if itab1-kposn <> 0.
            select single * from t685t
                              where kschl = itab1-kschl
                                and kappl = 'M'
                                and spras = 'EN'.
            iout-vtext = t685t-vtext.
            iout-kschl = itab1-kschl.
            iout-kbetr = itab1-kbetr.
            iout-kwert = itab1-kwert.
            append iout.
            clear iout.
          endif.
        endloop.
        sort itab1 by kposn.
        loop at iout.
          sort iout by kschl.
          if ( iout-kschl eq 'GSDC' OR
               iout-kschl eq 'GSFR' OR
               iout-kschl eq 'GSIR' ).
            at end of kschl.
              read table iout index sy-tabix.
              sum.
             write:/ iout-kschl,iout-vtext,iout-kwert.
          out_par-name = 'A1'.
          out_par-value = iout-vtext.
          append out_par.
          out_par-name = 'A2'.
          out_par-value = iout-kwert.
          append out_par.
              endat.
            endif.
          endloop.
        endif.
      endif.
    endform.
    IN THE FORM I AM WRITING THIS CODE.
    /:DEFINE &A1& = ' '
    /:DEFINE &A2& = ' '
    /:PERFORM GET_FREIGHT IN PROGRAM ZMFORM_PO1
    /:USING &EKKO-EBELN&
    /:CHANGING &A1&
    /:CHANGING &A2&
    /:ENDPERFORM
    &A1&
    &A2&
    This Code is to be written in the PO form under ADDRESS window.
    /:DEFINE &A1& = ' '
    /:DEFINE &A2& = ' '
    /:DEFINE &A3& = ' '
    /:DEFINE &A4& = ' '
    /:DEFINE &A5& = ' '
    /:DEFINE &A6& = ' '
    /:PERFORM GET_VENDOR IN PROGRAM ZMFORM_PO
    /:USING &EKKO-EBELN&
    /:CHANGING &A1&
    /:CHANGING &A2&
    /:CHANGING &A3&
    /:CHANGING &A4&
    /:CHANGING &A5&
    /:CHANGING &A6&
    /:ENDPERFORM
    &A1&
    &A2&
    &A3&
    &A4&
    &A5&
    &A6&
    Regards
    Anji

  • IF statement in SAPscript

    I'm probably making a really simple mistake, but I've got the following code in a SAPscript window:
    /: IF &REGUD-WRBTR& GT 0
    HE <S>DR></>
    /: ELSE
    HE <S>CR></>
    /: ENDIF
    I've debugged through the print program and REGUD-WRBTR is 1175.00 but it still prints CR.
    Any ideas?
    Gill

    use
    IF REGUD-WRBTR GT 0
    without &

  • Barcode C128 is not getting displayed in Sapscript

    HI,
    I need to print the barcode in the Sapscript.
    The barcode is not getting displayed even in the preview also, when I give the Barcode C128.
    But when I give other Barcodes, it is getting displayed in the preview.
    Can anyone let me know the solution to print the barcode for C128, as others are not that much fit to print.
    Thanks
    Rakesh

    Hi Dieter,
    No. I haven't.
    Is this the reason for that?
    let me know the procedure.
    thanks
    Rakesh

  • How can I transfer sapscript from one client to another

    Please tell me the steps , how can I <b>transfer</b> SAPscript from one client to another (like DEV Client to Test Client)?

    Hi,
    Utilities --> Copy from client.
    If you have to copy from once system to another use Program RSTXSCRP
    Regards,
    Satish
    Message was edited by:
            Satish Panakala

  • How can i print all the contect of the code in sapscript window ? ?

    how can i print all the contect of the code in sapscript window ? ?

    Hi,
    Do you mean that you want to print the ABAP code to SAPscrip form ?
    Svetlin

  • 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

  • Sapscript translated in non-english language - Garbled output as Email

    Hi Experts,
    I've translated a SAPscript  to Chinese and Thai language.
    As per my requirement, the output can either be printed, emailed or faxed.
    I'm using the standard include  RVADOPFO for Open form.
    For the english version, I'm able to recieve the properly formatted e-mail output.
    However in case of thai and chinese, the Thai and Chinese characters do not appear. Most of them are substituted with blank spaces and some are substituted with boxes and unknown characters. However, the numbers and english characters appear.
    Please help in getting the correct output.
    Thanks!
    Nitya.

    Hi,
    SAP 141343. PDF Conversion: Latin-2.
    SAP 141901. Customer-specific fonts for PDF conversion.
    SAP 163266. PDF conversion: character set for softfonts.
    SAP 171698. SAPconnect: Formats, conversion, device type.
    SAP 317851. Creating PDF format via spooler in 4.6C/4.6B/4.5B.
    SAP 322998. PDF conversion: Cyrillic support.
    SAP 323736. Restrictions with "PDF print" through spooler.
    SAP 398357. PDF converter: Width of letters is incorrect.
    SAP 414325. SAPconnect: Conversion of ALI to PDF.
    SAP 504952. Composite note spool and print.
    Find these notes, there You'll find some answers.
    Regards,
    Nisrin.

  • Gerar PDF com código de barras a partir de um SAPScript

    Bom Dia Senhores!
    Estou tendo problemas na geração de um arquivo PDF a partir de um SAPScript com código de barras.
    Tenho um formulário SAPScript que contém código de barras, este, é gerado pela F110.
    O programa precisa que este arquivo PDF gerado seja enviado por email, porém ao gerarmos um arquivo PDF deste SAPScript, o código de barras contido nele é meramente ilustrativo, ou seja, não sai com as informações certas do boleto, sai como imagem.
    É de meu conhecimento que se este formulário fosse um SmartForm sairia tudo perfeito já que a transformação do SmartForm em PDF mantém o código de barras de forma correta.
    Porém, se formos na SP01 e mandamos imprimir este SAPScript com a saída 'PDF Creator' ele gera o código de barras corretamente.
    Minha pergunta é se alguem conhece alguma função de transformação de SAPScript para PDF que funcione corretamente, algo similar ao funcionamento do PDFCreator.
    Obrigado;
    Daniel Salerno de Arruda

    Boa Tarde Daniel Salerno,
    Tenho o mesmo problema que você tinha.
    Gero um arquivo em PDF com Boleto de pagamento para enviar mas o código de barras neste arquivo é meramente ilustrativo e não consigo enviar o código para leitura.
    Este formulário está em SAPScript,
    Será que você pode me ajudar ?
    Obrigada.
    Solange Guimarães.

  • IF condition in Sapscript

    Hi all,
    Have created a new window in one of the scripts recently.
    I was asked to display this  window( with some data) only for company code NL01.
    So I kept the condition , IF reguh-zbukr = 'NL01'..and wrote the code..
    Now Im asked to extend the functionality to some other company codes..
    I have written code lke this..pls suggest whether it is correct or not...( I cant test this now..but no test data available as of now..so need your help..Thanks)
    /:IF &REGUH-ZBUKR& = 'NL01' OR  &REGUH-ZBUKR& = 'BE01' OR
    /=  &REGUH-ZBUKR& = 'BE02'
    ZI  Sold to
    /:   ENDIF

    Max notes correctly...but you might also consider:
    /: DEFINE &CO_SWITCH& = ' '
    /:PERFORM CHECK_COCO IN PROGRAM(your routines program)
    /:USING &REGUH-ZBUKR&
    /:CHANGING &CO_SWITCH&
    /:ENDPERFORM.
    /: IF &CO_SWITCH& eq 'X'
    ZI  Sold to
    /: ENDIF.
    Your CHECK_COCO routine would examin the value passed in and determine whether or not to set &CO_SWITCH ON or OFF.  This would allow you to read rows of customizing table or variables table, or apply logic to determine on/off, and you would not have to change your SAPScript in the future if the requirements changed.

  • Sapscript if statement

    hi,
    may i know why the if statement doesn't work in sapscript?
    IF &BSID-BUDAT& GE &RF140-DATU1&
    xxxx
    ELSE
    yyyy
    ENDIF
    (where &BSID-BUDAT& = 07.01.2008 and &RF140-DATU1& = 01.03.2008)
    actually march is greater than january but it still able to perform xxxx.
    it should perform yyyy and not xxxx.
    can have the advice?
    thanks
    rgds

    Dear,
    you have to do this in order to resove the problem.
    create a variable say z_status in your program not in script.
    then in program write this.
    data: z_staus type C.
    if bsid-budat GE rf140-datu1.
    clear z_status.
    z_status = 'Y'.
    else.
    clear z_status.
    endif.
    now in sapscript.
    IF z_staus eq 'Y'.
    xxxx
    ELSE
    yyyy
    ENDIF
    reward if useful.
    Amit Singla

  • Sapscript: IF statement over multiple lines ?

    Hi,
    in my sapscript i have to use an IF statement with many OR conditions
    /:   IF cond1 OR cond2 OR cond3 OR cond4 OR cond5 ........
    But i can't write it on one line. Even with SHIFT-F8 to go to the right the line lenght is too short.
    How can i solve this one ?
    regards,
    Hans

    Hi,
    This is not a solution, more a workaround but should avoid the line length problem.
    Define a flag in your form (/: DEFINE &IF_FLAG&), then you can call an ABAP subroutine to set the value of this flag (take a look at the online help for SAPscript PERFORM if you're not familiar with it).  The subroutine will contain your long IF statement and the SAPscript will just contain
    /: IF &IF_FLAG& = 'X'.
    Regards,
    Nick

  • My IF statement can't fit on 1 line in SAPSCRIPT

    Hello experts and friends,
    I am currently inserting a particular IF statement in a particular window in SAPSCRIPT editor(SE71) and it doesn't fit. Any suggestions? Thanks a lot guys!

    Hi,
    Put your cursor on the line that has the IF statement & use the menu option Edit--> Page Left/Right or 'Shift+F8'
    Regards,
    Suresh Datti

  • SAPSCRIPT form - Text is not porperly displayed

    hi all,
    in my SAPSCRIPT form, I am getting a text from PERFORM stmt. in the PERFORM , the text is coming correct, but in the form , it is showing only half of the text.
    the code
    FORM get_text TABLES ts_intab STRUCTURE itcsy
                         ts_outtab STRUCTURE itcsy.
    DATA: l_haul_text(500) TYPE c,  
               l_haul_long(250) TYPE c.
    l_haul_long = l_haul_text+0(250).
        LOOP AT ts_outtab.
          CASE ts_outtab-name.
            WHEN 'L_HAUL_LONG'.
              ts_outtab-value = l_haul_long.
              MODIFY ts_outtab.
          ENDCASE.
        ENDLOOP.
    Then in the form, just display
    /:  PERFORM GET_TEXT IN PROGRAM
    /:   USING &VBDKL-VBELN&
    /:   CHANGING &L_HAUL_LONG&
    /:  ENDPERFORM
    &L_HAUL_LONG&
    while debugging, the text is correct till TS_OUTTAB but when it comes to the form L_HAUL_LONG, it is truncated.......what should i do..
    Kindly help.
    THnaks

    answered

  • Fields not getting displayed in Sapscript

    Hi Guyz,
    I have a customized Sapscript form ZPV_INVOICE and its print program RVADIN01. This form outputs the Sales Invoice. When the print preview is triggered, Material number (MATNR) is not getting displayed on the form. However, when the form is debugged, MATNR values are properly fetched and showed (while debugging only, not in output).
    Can somebody please let me know the reason, why the MATNR is not getting displayed on the output, even though it is showing values while debugging.
    Thanks in advance !

    Hi ,
    Then check matnr  field which is display  is same  what you are checking  in debugging  .
    COnfirm  the field   and check whether data stays till end of module   .
    regards
    Deepak.

Maybe you are looking for

  • CS5 quicktime "MooV" error - can't render or preview...

    Hello everybody, I'm working on a project with a imported quicktime movie file. The file works just fine in quicktime player. But... when i try to render the project from AE CS5 i get this error: Rendering error while writing to file "/Users/etc....

  • Help with Hangman program

    I have been working on this program for more than a week. It is a Hangman program that is supposed to get input from a dialog box when the Guess button is clicked. Then the frame should display the word like so -a--- if the word is "magic." It does n

  • Error loading prefs

    Everything in my console.log as "error loading prefs - creating defaults one" at the end of it. What does this mean, and what do I do to fix this problem. I have already re-set my pref folder, but that seems to not do

  • Where do I find my subscriptions

    I just got an email to renew a subscription that I forgot I had and have never used.  I wanted to cancel the renewal, but can't find it. Where do I find my subscriptions?

  • RPC malloc not thread-safe?

    ENVIRONMENT: uname -aSunOS goose 5.8 Generic_108528-10 sun4u sparc SUNW,Sun-Blade-1000 CC -VCC: Sun WorkShop 6 update 2 C++ 5.3 2001/05/15 PROBLEM: I've got a huge C/C++ multi threaded application. Most of the execution contexts perform operations re