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

Similar Messages

  • Select statement in a sub routine(For Sapscript)

    Hi,
    M unable to write select statement for my reqirement in Sap-script in Sub routine.
    My requirement is 1)"Your correspondent for quality" in main window of my form.
    For dis rule is as below
    "Get the 'changed by' value resord in table QCPR field AENDERER.For the same value found in tabe USR21 fiels BNAME,pick up the PERSUNUM value.For dis PERSUNUM value, found in ADRP feild NAME_TEXT the value for "Your Correspondent for Quality".
    2) For this PERSUNUM value found in ADCP-TEL_NUMBER the vakue for "Ph".
    3)For this PERSUNUM value found in ADCP-FAX_NUMBER the vakue for "FAX".
    4For this PERSUNUM value found in ADR6-SMTP_ADDR the vakue for "EMAIL".
    Please help me out it's urgent for me.I wil b waiting 4 ur reply.

    READ TABLE in_par WITH KEY 'QCPR-AENDERER'.
      CHECK sy-subrc = 0.
      MOVE in_par-value TO V_aenderer
    .  READ TABLE in_par WITH KEY 'USR21-BNAME.
      CHECK sy-subrc = 0.
      MOVE in_par-value TO V_bname
      SELECT SINGLE persnumber addrnumber
        INTO wa_usr21-persnumber wa_usr21-addrnumber
        FROM usr21
        WHERE bname = V_bname
    and <b>check field for this</b> = V_aenderer.
      CHECK sy-subrc = 0.
      SELECT SINGLE tel_number fax_number
        INTO adcp-tel_number adcp-fax_number
        FROM adcp
        WHERE addrnumber = usr21-addrnumber
          AND persnumber = usr21-persnumber.
      CHECK sy-subrc = 0.
      READ TABLE out_par WITH KEY 'ADCP-TEL_NUMBER'.
      CHECK sy-subrc = 0.
      out_par-value = adcp-tel_number.
      MODIFY out_par INDEX sy-tabix.
      READ TABLE out_par WITH KEY 'ADCP-FAX_NUMBER'.
      CHECK sy-subrc = 0.
      out_par-value = adcp-fax_number.
      MODIFY out_par INDEX sy-tabix.
      SELECT SINGLE smtp_addr
        INTO adr6-smtp_addr
        FROM adr6
        WHERE addrnumber = usr21-addrnumber
          AND persnumber = usr21-persnumber.
      READ TABLE out_par WITH KEY 'ADR6-SMTP_ADDR'.
      CHECK sy-subrc = 0.
      out_par-value = adr6-smtp_addr.
      MODIFY out_par INDEX sy-tabix.
    Regards

  • PO Output: Processing Routine

    Hi all,
    Under "Processing Routine" for the PO Output setup, we can assign the print program, form routine and the SAPScript name.  There are more than one entries you can set as the assignment starts from "Processing 1" up to "Processing 5".
    I normally set up the program name, routine and SAPScript under "Processing 1" columns.  I wonder what are the rest are used for?
    Any idea?
    Thanks.
    Tom

    Hi Tom,
    thanks for the extra info.
    I can only guess at the reason for the other options because I have never seen anyone mainatin anything other than "processing 1" and everything works fine.
    perhaps it is a method of having alternative forms and programs that can be used in different situations - sorry, stating the obvious here 
    I don't know how the system would know to use an alternative and which one to use? Perhaps there is some hidden code that trys the next entry if the first one fails????? perhaps it is connected to the "layout module" field on the same screen? Perhaps this uses logic to determine which combination to use depending on the circumstances?
    It is a really good question, but unless you need to use the alternatives for any reason, I guess that is is just "nice to know" the logic?
    Steve B

  • New sapscript for VT02N

    Hi,
    the print program i´using is Z_RVADRT01 (copy of RVADTR01)
    and the sapscript form is Z_SD_SHIPMENT (copy of SD_SHIPMENT).
    In the Z print program i use the following code to get the simulated
    price:
    CALL FUNCTION 'SD_SCD_COST_INFO_SHIPMENT'
      EXPORTING
        i_shipment_data = l_shipment_data
       i_opt_dialog    = false
        I_OPT_BATCH_MODE = 'X'
        i_opt_sim       = 3
      IMPORTING
        E_RESULT        = l_result
        E_RESULT_WAERS  = l_result_waers
        E_ERRORS_OCCURED = l_errors_occurred.
    Note here that we´re in batch mode(I_OPT_BATCH_MODE = 'X')
    In IMG i believe i´ve assigned correctly the message class
    to the print program, routine and sapscript form.
    When i display a message already created there´s no problem ...
    but when i use transaction VT02N and generate a new message by
    saving, the flow of the program does not pass through
    Z print program thus losing the data i´m interested in.
    Why is this happening?
    Best regards.

    Hi Clemens,
    thanks for the tip.
    <u>The problem lies in here</u>:
    <b>PERFORM SCD_COST_INFO_INTERFACE_FILL in program SAPMV56A
    USING vttkvb-tknum
    CHANGING l_shipment_data</b>.
    CALL FUNCTION 'SD_SCD_COST_INFO_SHIPMENT'
      EXPORTING
        i_shipment_data = l_shipment_data
       i_opt_dialog    = false
        I_OPT_BATCH_MODE = 'X'
        i_opt_sim       = 3
      IMPORTING
        E_RESULT        = l_result
        E_RESULT_WAERS  = l_result_waers
        E_ERRORS_OCCURED = l_errors_occurred.
    The flow of the program passes through the Z print program but the sentence
    <b>PERFORM SCD_COST_INFO_INTERFACE_FILL ....</b>
    <u>does not populate "l_shipment_data".</u>
    Why does it work for display sapscript from screen but not when i save a new message?
    Best regards.

  • Issue with  driver program ZSAPM07DR(From where this Program is called)

    Hi All,
    We need  to find out from  where the driver program  ZSAPM07DR(this is a customized program of SAPM07DR). It has the
    form  Z_DLYNOTE .
       So how to know from  which place the Driver program is called.
    Please help .
    Thanks and Regards
    Channappa Sajjanar

    Hi,
    It is me not totally clear what you want with this question.
    I think you are asking this because you want to change the calling program in such a way that is using the new ZSAPM07DR instead of SAPM07DR.
    For this you do not have to change a program. This can be done by making settings (a kind of customizing).
    Your print will be made with a certain outputtype. (ithink 1 of WA01, Wa02,Wa03, wae1, wae2, wae3, wee1, wee2, wee3, wf01, wf02, wlb1, wlb2, wlb3) with apllicationtype ME.
    The settings can be made with transaction NACE.
    for your program> start transaction NACE
                                  click on application ME
                                  click on outputtype
                                  doubleclick on the right outputtype
    then you see a prgram, a starting routine, and  sapscript or smartform name.
    Here you change your settings to your program and your sapscript or smartform or adobe interactive forms.
    and save.
    these setting are stored in table TNAPR.
    Hope this helps you. success.
    Gr., Frank

  • PERFORM ENTRY_NEU IN PROGRAM parameters error

    Hi,
    Looking for the cause of this error please:
    "Short text: Too many parameters specified with PERFORM.
    The reason for the exception is:
    A PERFORM was used to call the routine "ENTRY_NEU" of the program
    "Z_PGM".
    This routine contains 2 formal parameters, but the current call
    contains 4 actual parameters."
    Sapscript:
    /: PERFORM ENTRY_NEU IN PROGRAM Z_PGM
    /: USING SPACE
    /: USING SPACE
    /: ENDPERFORM
    Z_PGM:
    form entry_neu using return_code us_screen.
    coding here...
    endform.
    Thks,
    William

    Hi William,
    The pasted code that you show for your form routine doesn't look good. Whenever you call a form routine from SAPscript, they must be of the following form (standardized interface):
    FORM <form> TABLES in_params  STRUCTURE ITCSY
                       out_params STRUCTURE ITCSY.
    * Coding
    ENDFORM.
    Structure ITCSY has two fields, representing the parameter name (NAME) and the corresponding parameter value (VALUE). You can find an explanation with more details in the [SAP help link pasted by Rob above|http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm] or you can also check the corresponding entry in the [wiki|http://wiki.sdn.sap.com/wiki/display/ABAP/SUBROUTINESANDTHEIRUSEIN+SAPSCRIPT].
    So please adjust your form routine ENTRY_NEU so that it's compliant with the required interface. One more comment though: Your call looks a bit odd, because ENTRY_NEU is often the default name within a print program for triggering the SAPscript output. This form routine is usually called by the standard SAP printing framework (i.e. configuration of output type). Thus the name of the form sounds a bit odd to me, but maybe in your case it's something different...
    Best wishes, harald

  • Debugging driver program for SAP SCrIPT

    Hi,
    I am using a z report for creating handling units.As soon as the handling units are created the spool is genearted for all the handling units and the spool requests are visible in SP01.However the print ouput is having some error.I want to debug the driver program.Fronm nace I found out the driver program and have placed break-point in the form routine Entry sapscript and also activated thhe debugger for te concerned SCript,but the debugger is not stopping .
    Also I have checked the script name from the spool.
    Kindly guide where is the problem and how to proceed.Any help will be acknowledged.
    Regards,
    Abhishek

    HI,
    Write  a infinite loop  in the diver program before u call the open form or before the statement from where you want to debug.
    set the infinite loop by this code.
    data no type i value 1.
    while no eq 1.
    endwhile.
    break-point.
    Then after inserting this code activate and run the program, then run the transaction after runing the transaction ,
    goto TCODE ->SM50 u will see list of program select the driver program then select program/session from menu then select program->debugging, then your debug will start from the infinite loop , then change to 2 , then u can debug the program.
    Hope this helps.
    Regards,
    Madhukar Shetty

  • Send an email from ME38??

    hello,
    In transaction NACE i defined a program, routine and sapscript for message class LPET with NACHA = 7 (e-mail)
    then, when i go to transaction ME38 for a specific document, i enter one new message for LPET and the specific partner, but when i want to save it, i have an information popup that tell me something like the partner have not an email or something like that.
    i want to know what is happening.
    i upload some pics, please help me!
    http://img201.imageshack.us/img201/6167/41666918.jpg
    http://img230.imageshack.us/img230/9917/222uf.jpg
    http://img97.imageshack.us/img97/92/90334942.jpg
    Greetings.

    NACHA = 7 is not for e-mail! it is for SAPinternal Mail
    use NACHA = 5 for e-mail

  • Develop scripts from scratch

    Hi
    I am new to scripts.
    Suggest me how to develop scripts from scratch,
    and also suggest me how to modify the predefined scripts.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 9:44 AM

    What do u mean by using standard scripts?? Do u want to learn from basics???
    If so
    Link for SAP Scripts (step by step procedure)
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Create_A_SAPSCRIPT_Form/How_to_Create_SAPSCRIPT.html
    SAPScripts
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    SAP SCRIPT FIELDS
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
    scripts easy material
    http://www.allsaplinks.com/sap_script_made_easy.html
    http://www.sappoint.com/abap/ssintro.pdf
    http://www.sappoint.com/abap/sscript.pdf
    http://www.sappoint.com/abap/sscript.pdf
    http://www.sappoint.com/abap/lsetssap.pdf
    http://www.sappoint.com/abap/sscrtpex1.pdf
    http://www.sap-img.com/sapscripts.htm
    http://www.thespot4sap.com/Articles/SAPscript_Introduction.asp
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SAPSCRIPTS_tutorial.html
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRPROG/BCSRVSCRPROG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRRDI/BCSRVSCRRDI.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCREDIT/BCSRVSCREDIT.pdf
    http://www.sappoint.com/abap/sscrtpex1.pdf
    http://www.sap-img.com/sapscripts.htm
    http://www.esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    Other Links
    http://www.virtuosollc.com/PDF/Get_Reporter.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/da/6ada3889432f48e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/66/bc7d2543c211d182b30000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22cee43c611d182b30000e829fbfe/frameset.htm
    http://www.virtuosollc.com/PDF/Get_Reporter.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/da/6ada3889432f48e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/66/bc7d2543c211d182b30000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22cee43c611d182b30000e829fbfe/frameset.htm
    http://www.thespot4sap.com/Articles/Code_CostCentreReport.asp
    http://www.allsaplinks.com/dialog_programming.html
    http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/frameset.htm
    http://www.allsaplinks.com/files/using_table_in_screen.pdf
    http://www.geocities.com/ZSAPcHAT
    DIFF BETWEEN SCRIPTS N SMARTFORMS
    SAPscript technology is based on a mainframe product from the 1980s, while Smart Forms have only been around since (roughly) 2001. With that sort of time gap, there are bound to be significant differences between the two tools. Client dependence is a fundamental one. Although SAPscript has had some incremental improvements over time, its forms have always been -- under the hood -- relatively ...
    1. script is client dependent one while smartform is client independent.
    2. In scripts we have to write print program while in smart forms it is not necessary.
    3. In scripts we can print background logo while in smartforms we cant print background logo
    4. In scripts we have 99 main windows while in smartforms we have only 1 main window.
    5. In scripts we should write paragraph format otherwise we cant execute program while in smartforms no need to create paragraph formats .
    6. In scripts we can print the text in only two character formats.
    while in smartforms we can do with more.
    7. In scripts we dont have line types while in smartforms we have linetypes.
    also refer
    difference between smartforms and scripts
    Diff betwen Scripts & smartforms
    advantages of smartforms over scripts
    the main diffarences between smart form and script form are:
    1) smart forms are clinent independent where as scripts are client dependent.
    2) smart form require half the time to create and maintain forms compare with
    script.
    3) smart forms provide multiple page formats where as in script not possible
    4) smart forms exisist without main window also where as in script not possible.
    5) smart form is entairely graphical user interface comapre with script.
    6) labeling is not possible in smart form where as it is possible in script.
    7) smart form genarate function module whenver it activate where as script
    doesn't genarate.
    8) smart form can easily web publishing using the genarated XML output compare
    with script.
    9) using smart forms we can design web forms but bot possible with script.
    10) we can maintain background graphics in smartform wher as in script not
    possible.
    11) in smart form we use transaction codes SMARTFORM for designing FORM
    and SMARTSTYLES to create differnt styles of text, where as in script we
    use SE71 for form painter and SE72 for different styles of text and font.
    12) we can migrate script to smart form vice-versa is not possible.
    I'm having a good material on scripts If u want i'll provide that material to you
    How to take a print of SAP Script
    How to take a print of SAP Script
    how to find 'Z' script layouts
    how to find 'Z' script layouts
    SAP Script: Lines is not included in printing
    SAP Script: Lines is not included in printing
    what is the use of (E.0C) in Text element in SAP Script
    what is the use of (E.0C) in Text element in SAP Script
    SAPSCRIPT
    SAPSCRIPT
    SAP script PO print problem
    SAP script PO print problem
    How to insert a condition in the Graphic Window of a SAP Script ?
    How to insert a condition in the Graphic Window of a SAP Script ?
    script debug
    about script debug
    routine in sapscript
    routine in sapscript
    Check these links posted by me previously
    Converting Scripts from one language to another!
    scripts
    Scripts
    Regards

  • How to psss a table from sapscript to routine program

    HI,
    i want to pass a table from sapscript to routine program.
    the requirment is to sor the table by material number wise.
    how do we pass throug itcsy structure.
    Regards,
    Balachandran

    REPORT YMMR_TDS_LPRG .
    TABLES: ADRC."Central address administration
          FORM FETCH_VEN_ADD                                            *
    -->  IN_TAB                                                        *
    -->  OUT_TAB                                                       *
    FORM FETCH_VEN_ADD TABLES IN_TAB STRUCTURE ITCSY
                              OUT_TAB STRUCTURE ITCSY.
      DATA: L_STREET4 LIKE ADRC-CITY2,
            L_STREET5 LIKE ADRC-LOCATION,
            L_INDEX1 LIKE SY-TABIX.
      DATA: LEN TYPE I.
      DATA: Z1(5) VALUE '00000'.
      LEN = STRLEN( IN_TAB-VALUE ).
      IF LEN = 5.
        CONCATENATE '00000' IN_TAB-VALUE INTO IN_TAB-VALUE.
      ELSEIF LEN = 6.
        CONCATENATE '0000' IN_TAB-VALUE INTO IN_TAB-VALUE.
      ENDIF.
      SELECT CITY2 LOCATION FROM ADRC
      INTO (L_STREET4,L_STREET5)
      WHERE ADDRNUMBER = IN_TAB-VALUE.
        IF SY-SUBRC = 0.
          LOOP AT OUT_TAB.
            CLEAR L_INDEX1.
            IF OUT_TAB-NAME = 'ADRC-CITY2'.
              L_INDEX1 = SY-TABIX.
              OUT_TAB-VALUE = L_STREET4.
              MODIFY OUT_TAB INDEX L_INDEX1 TRANSPORTING VALUE.
            ELSE.
              L_INDEX1 = SY-TABIX.
              OUT_TAB-VALUE = L_STREET5.
              MODIFY OUT_TAB INDEX L_INDEX1 TRANSPORTING VALUE.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDSELECT.
    ENDFORM.
    Se71
    /:PERFORM FETCH_VEN_ADD IN PROGRAM YMMR_TDS_LPRG
    /:USING &T001-ADRNR&
    /:CHANGING &ADRC-CITY2&
    /:CHANGING &ADRC-LOCATION&
    /:ENDPERFORM

  • 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.

  • Addint new field to the standard sapscript form.

    FOR SALES INVOICE DOCUMENT FORM PRINTING
    TRANSACTION CODE: VF01
    OUTPUT TYPE : FJCI
    PROGRAM NAME: RVADAUS1
    SAPSCRIPT FORM NAME: SD_EXPORT_FJCI
    ENTRY ROUTINE: ENTRY_FJCI.
    STRUCTURE USED FOR THIS OUTPUT TYPE = V55EFJCI
    THE QUERY IS AS FOLLOWS:
    I WANT TO ADD DATA MODE OF TRANSPORT FROM THE INVOICE DOCUMENT. THE TABLE AND FIELD IS T618-BEZEI.
    SO I COPIED THE STANDARD FORM TO ZSD_EXPORT_FJCI AND THE STANDARD PROGRAM TO ZRVADAUS1.
    I SUCCESSFULLY FETCHED THAT FIELD DATA.
    I APPEND THE STRUCTURE 'ZAV55EFJCI' TO ADD THE ADDITIONAL T618-BEZEI FIELD.
    AND WRITE MY SELECT QUERY IN THE ENTRY_FJCI FORM ROUTINE.
    THE CODE IS AS FOLLOWS:
    data: begin of it_mode_of_tp occurs 1,
          bezei type t618t-bezei,
          end of it_mode_of_tp.
    select a~bezei as zzbezei into table it_mode_of_tp from t618t as a
    inner join
    eikp as b on aexpvz = bexpvz and aland1 = baland inner join vbrk as
    c on bexnum = cexnum
    where cvbeln = nast-objky and aspras = nast-spras .
    loop at it_mode_of_tp.
       v55efjci-zzbezei = it_mode_of_tp-bezei.
    endloop.
    BUT THE DATA FOR THAT IS NOT GETTING DISPLAYED.
    THIS WAS THE FIRST METHOD I FOLLOWD.
    THE SECOND METHOD I DID WAS AS FOLLOWS:
    FORM ENTRY_FJCI.
         PERFORM PROCESSING.
    ENDFORM
    FORM PROCESSING.
         PERFORM PRINT_DOCUMENT.
    ENDFORM.
    FORM PRINT_DOCUMENT.
           CALL FUNCTION 'RV_EXPORT_DOCUMENT_PRINT'
    ENDFORM.
    IN THIS FUNCTION THE DATA IS GETTING FETCHED FROM THE DATABASE TABLES AND STORED IN THE STRUCURE V55EFJCI.
    SO I COPIED THAT FUNCTION.
    IN THIS FUNCTION , THEIR IS A INCLUDE PROGRAM 'LV55EF11' FOR FETCHING DATA FOR ENTRY_FJCI FORM ROUTINE.
    I COPIED THAT PROGRAM CODE , AND CREATED MY OWN INCLUDE PROGRAM (WHICH I AM STORING IT IN ANOTHER Z PACKAGE.)
    AND WRITTEN MY ABOVE CODE IN THAT PROGRAM. BUT WHEN I DO THIS, NOITHING GETS DISPLAYED , EVEN THE PREVIOUSLY COMING DATA ALSO NOT GETTING DISPLAYED.
    HOW SHOULD I PROCEED.

    you said you copied layout(form) SD_EXPORT_FJCI to ZSD_EXPORT_FJCI,
    you updated program to fetch datat & populate v55efjci-zzbezei field.
    Now
    - you need to modify layout(form) ZSD_EXPORT_FJCI via SE71 to insert your field in one of the windows where it has to be printed (sap script knowledge is required here).
    - you need to either modify SAP output type FJCI to use your program/layout(form) or you need to create your own output type and assign your form/program to it, and in addition to that if you define your own output type - yo have to add it to output determination procedure, to access sequences, add condition records to condition table... so it's picked up by the invoice.

  • Need Material Description in SAPscript Export Packing list

    Hi Friends,
                    I copied standard SAPscript form SD_EXPORT_FUEP for Export packing list. I need a Material description in main window but not able to get. Please tell me how to get the material description.
    Thanks,
    Ziad

    Hi Surya,
                  Here is my subroutine,please check it. Still I am not getting description.
    PROGRAM  ZSD_EXPORT.
    tables: VBRP, VBRK, V55ENAFT.
    ********form routine to fetch the material description
    form GET_DESC tables in_par  structure itcsy
                         out_par structure itcsy.
    DATA: BEGIN OF S_MAT.
         VBELN TYPE VBRP-VBELN,
         POSNR type VBRP-POSNR,
         ARKTX  type VBRP-ARKTX,
           include structure vbrp.
    data:      END OF S_MAT.
    data: it_line like V55ENAFT-POSNR,
          inv_no  like V55ENAFT-VBELN.
    data: mat_desc  type VBRP-ARKTX.
    read table in_par with key 'ITLINE'.
    check sy-subrc = 0.
    it_line = in_par-value.
    read table in_par with key 'INV'.
    check sy-subrc = 0.
    INV_NO = in_par-value.
    *SELECT SINGLE VBELN POSNR ARKTX FROM VBRP INTO S_MAT where vbeln = inv_no and posnr = it_line.
    select single * from vbrk
    where vbeln = inv_no.
    SELECT SINGLE * FROM VBRP
    WHERE VBELN = vbrk-vbeln AND POSNR = IT_LINE.
    move vbrp-arktx to mat_desc.
    read table out_par with key 'DESC'.
    check sy-subrc = 0.
    out_par-value = mat_desc.
    modify out_par index sy-tabix.
    endform.               "get_desc
    Thanks,
    Ziad

  • How do I return a numeric value to a Sapscript

    Hi,
    I'm calling a subroutine from a sapscript using the perform command. I'm passing a material number to the routine and it is suppose to return the unit price of the material to the sapscript form. This is not working because the field is a currency field and according to the documentation I read so far, the return values must be character strings, so how can I pass his non-character string value back to the sapscript form.
    Please assist.
    Thanks
    Chris

    In column D I will insert the formula:
    =IF(OR(ISBLANK(B),ISBLANK(C)),"",IF(C>B,"",1))
    In A1 I will insert:
    =SUM(D)<0
    or
    in column D
    =IF(OR(ISBLANK(B),ISBLANK(C)),"",C>B)
    in A1
    =COUNTIF(D,FALSE)=0
    Yvan KOENIG (from FRANCE mardi 2 septembre 2008 12:11:28)

  • PO Output Type / Processing Routine Problem

    Hello everyone,
    I cannot seem to find any reference to the problem described below.
    I have encountered a problem by migrating from SAPFM06P to SAPLMEDRUCK during an ECC 5.0 upgrade, at a client where I am under contract as an ABAP Developer.
    Here is some background to the situation.  The client is currently migrating from version 4.6C to 5.0 and thought it was a good idea to upgrade their purchase order messaging  programs from the outdated SAPFM06P, which was utilized in version 3.x, to the newer program SAPLMEDRUCK implemented for use in version 4.6.
    Specifically, Message Output (ME9F) controls the output of purchase order messages in foreground, when the purchase order message is saved and the "further Data option" of the PO message contains "requested processing" equal to the value of "send with application own transaction".  This way, the actual messaging can be controlled in foreground and "breakpoints" can be set to display tables and fields.  Behind the scenes, the message status program RSNAST00 is executed by ME9F program RM06ENDR_ALV.  During this execution, it locates the message (NAST) record from the purchase order and the (TNAPR) configuration, which links the output type to the ABAP print program and SAPscript layout set.  The specific problem is: in RSNAST00, the external call perform "PERFORM (TNAPR-RONAM) in PROGRAM (TNAPR-PGNAM) USING RETURNCODE US_SCREEN IF FOUND" does not pass NAST information to the called program (TNAPR-PGNAM).  I know no NAST table information is passed because I set a break-point on the perform and single step to the print program.  Therefore, the purchase order is unknown by the print program (TNAPR-PGNAM) and results in an error and no purchase order print is provided.  Needless to say, this was tested with a new "Z" version of SAPLMEDRUCK.  So, I changed the program name (output type processing routine) in configuration to SAPLMEDRUCK, but there again the NAST information is not passed to the print program from RSNAST00.  Ironically, I reverted back to the older "z" version of SAPFM06P and NAST and TNAPR information is passed to the print program thru the external call perform quoted above.  I prefer to not modify the SAP original code for RSNAST00, which is used in many other applications.
    One other note, I had previously performed this maneuver on one different occasion with very successful results.
    Has anyone ever encountered this problem in a 5.0 environment (running Windows NT and MSSQL and SAP BASIS 6.4).
    I know this is long winded, but I wanted to explain the background of the entire situation.
    Any and all help would be appreciated.  Thanks in advance,

    Dave,
    Your entry points (like form ENTRY_NEU) should remain in your current version of SAPFM06P.  Change that form to reflect the function calls in the new SAPLMEDRUCK form (ENTRY_NEU) (calls to ME_READ_PO_FOR_PRINTING and ME_PO_PRINT.
    Look at the example below:
    Here is the form in your old (Z) version of SAPFM06P:
    FORM ENTRY_NEU USING ENT_RETCO ENT_SCREEN.
    XSCREEN = ENT_SCREEN.
    IF NAST-AENDE EQ SPACE.
       XDRUVO = '1'.
    ELSE.
       XDRUVO = '2'.
    ENDIF.
    CLEAR: XFZ, XOFFEN, XLMAHN, XLPET.
    *- Anstoß Verarbeitung -
    CLEAR ENT_RETCO.
    PERFORM LESEN USING NAST.
    MOVE RETCO TO ENT_RETCO.
    ENDFORM.
    Here is form entry_neu in your new (Z) version of SAPFM06P:
      INCLUDE FM06PE02                                                   *
    form entry_neu using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '1'.
      else.
        l_druvo = '2'.
      endif.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    Remember, the form should be in the Z version of SAPFM06P - not the Z version of SAPLMEDRUCK.  Make sure the configuration (TNAPR) has the SAPFM06P program name and entry point.
    It should work.  Let me know how it goes.
    Rick

Maybe you are looking for

  • Euro symbol in JSP

    <p>Hi all,</p><p>I have a strange behaviour in a report displaying Euro symbol: a '?' take the place of Euro symbol. Instead, exporting the report in PDF or RTF format, the symbol is displayed correctly in the documents generated. The JSP displaying

  • Links stop working

    I created a link in a PDF to open a file and it worked just fine. Now after several Adobe updates they stopped working both using Acrobat 8 Pro and Reader 9. I checked the link and in the link it points to the correct location of the file on the hard

  • SAP FI Consultant

    Hi I would like to learn about SAP financial module, so that i can work as consultant. I have an experience on small financial software support Can someone suggest where to start from ? thank you

  • All the cluster services missing

    I'm trying to setup the rendering farm for 5 MacPro but I couldn't see any available service node in the Qmaster for me to setup. I've share all the service for the computers but I still can't see non of it available in the cluster. Anyone can advise

  • RSA1 doesn't work!!!!

    Hi Friends, I've got a big problem. I was modifying an open hub destination, including a routine assignment in the transformation rule. After execution the DTP, the system gave me a Dump. After that, the system took me out of RSA1. I tried to re-ente