Reg:How to add fields to the scripts in detail

How to add fields to the scripts in detail.
Plz give me one example help me out.

Hi
add fields to the scripts by sending that field between  two &s.
for example if u want to add lifnr of lfa1 table then pass field like this.
&wa_lfa1-lifnr&.here wa_lfa1 is work area for internal table it_lfa1.
if name1 then &wa_lfa1-name1&
in this way you can add fields to the script under any window.
i am sending one example program for scripts.
&--structure declaration--
TYPES:BEGIN OF ST_LFA1,
      LIFNR TYPE LFA1-LIFNR,
      NAME1 TYPE LFA1-NAME1,
      LAND1 TYPE LFA1-LAND1,
      ORT01 TYPE ORT01,
      REGIO TYPE REGIO,
      END OF ST_LFA1.
TYPES:BEGIN OF ST_EKKO,
      EBELN TYPE EKKO-EBELN,
      BUKRS TYPE EKKO-BUKRS,
      AEDAT TYPE EKKO-AEDAT,
      ERNAM TYPE EKKO-ERNAM,
      BSTYP TYPE EKKO-BSTYP,
      LIFNR TYPE EKKO-LIFNR,
      END OF ST_EKKO.
TYPES:BEGIN OF ST_EKPO,
      EBELN TYPE EKPO-EBELN,
      EBELP TYPE EKPO-EBELP,
      LOEKZ TYPE EKPO-LOEKZ,
      AEDAT TYPE EKPO-AEDAT,
      MATNR TYPE EKPO-MATNR,
      NETWR TYPE EKPO-NETWR,
      END OF ST_EKPO.
&--internal table,work area declaration--
DATA:WA_LFA1 TYPE ST_LFA1,
     IT_LFA1 TYPE STANDARD TABLE OF ST_LFA1,
     WA_EKKO TYPE ST_EKKO,
     IT_EKKO TYPE STANDARD TABLE OF ST_EKKO,
     WA_EKPO TYPE ST_EKPO,
     IT_EKPO TYPE STANDARD TABLE OF ST_EKPO.
&--data declaration--
DATA:TOTAL TYPE EKPO-NETWR,
      V_EBELN TYPE EKKO-EBELN.
data: v_item(20) type c.
&--parameter for purchase document number--
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS P_PURDOC LIKE V_EBELN.
SELECTION-SCREEN END OF BLOCK B1.
START-OF-SELECTION.
  PERFORM GET_DATA_FROM_EKKO.
  PERFORM GET_DATA_FROM_LFA1.
  PERFORM GET_DATA_FROM_EKPO.
&--grand total--
  LOOP AT IT_EKPO INTO WA_EKPO.
    TOTAL = TOTAL + WA_EKPO-NETWR.
    CLEAR WA_EKPO.
  ENDLOOP.
&--open form--
  CALL FUNCTION 'OPEN_FORM'
   EXPORTING
    DEVICE                            = 'PRINTER'
    FORM                              = 'Z_50886_VENDOR'
    LANGUAGE                          = SY-LANGU
   EXCEPTIONS
     CANCELED                          = 1
     DEVICE                            = 2
     FORM                              = 3
     OPTIONS                           = 4
     UNCLOSED                          = 5
     MAIL_OPTIONS                      = 6
     ARCHIVE_ERROR                     = 7
     INVALID_FAX_NUMBER                = 8
     MORE_PARAMS_NEEDED_IN_BATCH       = 9
     SPOOL_ERROR                       = 10
     CODEPAGE                          = 11
     OTHERS                            = 12
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
&--write form for header details--
  READ TABLE IT_EKKO INTO WA_EKKO INDEX 1.
  CALL FUNCTION 'WRITE_FORM'
   EXPORTING
     ELEMENT                        = 'HEAD'
     WINDOW                         = 'HEADER'
   EXCEPTIONS
     ELEMENT                        = 1
     FUNCTION                       = 2
     TYPE                           = 3
     UNOPENED                       = 4
     UNSTARTED                      = 5
     WINDOW                         = 6
     BAD_PAGEFORMAT_FOR_PRINT       = 7
     SPOOL_ERROR                    = 8
     CODEPAGE                       = 9
     OTHERS                         = 10
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
&--write form for item details--
  LOOP AT IT_EKPO INTO WA_EKPO.
  concatenate wa_ekko-ebeln wa_ekpo-ebelp into v_item.
    CALL FUNCTION 'WRITE_FORM'
     EXPORTING
       ELEMENT                        = 'ITEM'
       WINDOW                         = 'MAIN'
EXCEPTIONS
   ELEMENT                        = 1
   FUNCTION                       = 2
   TYPE                           = 3
   UNOPENED                       = 4
   UNSTARTED                      = 5
   WINDOW                         = 6
   BAD_PAGEFORMAT_FOR_PRINT       = 7
   SPOOL_ERROR                    = 8
   CODEPAGE                       = 9
   OTHERS                         = 10
    IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ENDLOOP.
&--write form for vendor details--
  READ TABLE IT_LFA1 INTO WA_LFA1 INDEX 1.
  CALL FUNCTION 'WRITE_FORM'
   EXPORTING
     ELEMENT                        = 'VENDOR'
     WINDOW                         = 'ADDRESS'
   EXCEPTIONS
     ELEMENT                        = 1
     FUNCTION                       = 2
     TYPE                           = 3
     UNOPENED                       = 4
     UNSTARTED                      = 5
     WINDOW                         = 6
     BAD_PAGEFORMAT_FOR_PRINT       = 7
     SPOOL_ERROR                    = 8
     CODEPAGE                       = 9
     OTHERS                         = 10.
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
&--write form for grand total--
CALL FUNCTION 'WRITE_FORM'
EXPORTING
    WINDOW                         = 'TOTAL'
EXCEPTIONS
   ELEMENT                        = 1
   FUNCTION                       = 2
   TYPE                           = 3
   UNOPENED                       = 4
   UNSTARTED                      = 5
   WINDOW                         = 6
   BAD_PAGEFORMAT_FOR_PRINT       = 7
   SPOOL_ERROR                    = 8
   CODEPAGE                       = 9
   OTHERS                         = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
&--close form--
  CALL FUNCTION 'CLOSE_FORM'
   EXCEPTIONS
     UNOPENED                       = 1
     BAD_PAGEFORMAT_FOR_PRINT       = 2
     SEND_ERROR                     = 3
     SPOOL_ERROR                    = 4
     CODEPAGE                       = 5
     OTHERS                         = 6
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
*&      Form  get_data_from_ekko
FORM GET_DATA_FROM_EKKO .
  SELECT EBELN
         BUKRS
         AEDAT
         ERNAM
         BSTYP
         LIFNR
      FROM EKKO INTO TABLE IT_EKKO WHERE EBELN = P_PURDOC.
ENDFORM.                    " get_data_from_ekko
*&      Form  get_data_from_lfa1
FORM GET_DATA_FROM_LFA1 .
  IF NOT IT_EKKO[] IS INITIAL.
    SELECT LIFNR
           NAME1
           LAND1
           ORT01
           REGIO
           FROM LFA1 INTO TABLE IT_LFA1 FOR ALL ENTRIES IN IT_EKKO WHERE
                LIFNR = IT_EKKO-LIFNR.
  ENDIF.
ENDFORM.                    " get_data_from_lfa1
*&      Form  get_data_from_ekpo
FORM GET_DATA_FROM_EKPO .
  IF NOT IT_EKKO[] IS INITIAL.
    SELECT EBELN
           EBELP
           LOEKZ
           AEDAT
           MATNR
           NETWR
           FROM EKPO INTO TABLE IT_EKPO
           WHERE EBELN = P_PURDOC.
  ENDIF.
ENDFORM.                    " get_data_from_ekpo

Similar Messages

  • How to add field to the header for FBL5N ALV report

    Hi,
       I need to add fields to the customer line item display ALV report(FBL5N) header part.Right now there are four fields in the header like customer, company code, name and city, after that I need to add first name last name and phone no. Can any one tell me where exactly I need to add and populate there fields to be appear in ALV output list.
    Thanks in Advance
    Swapna

    Yes I have tried, I have place a break point in that perform but it does not stop. I think that is not the correct place to added and populate fields. That routine is for populate selection screen ranges single and multiple values and parameters only.
    Thanks
    Swapna

  • How to  fill  fields in the script ..

    Hai
    I wanted to make sap script which have excise details .
    It has total 17 fields .. the standard example is J_2i_rg1 is the standard sap form.
    and program name is j_2irrg1 . my out put will also similar to this ..
    my problem is how i have to fill all the filelds in custom script. and how to allign correctly .
    Please let me know .... tell me step by   step procedure
    Thankyou.
    Regards
    Harsha

    Hi,
    Are you copying the driver program and SAP print form from the standard one. If you are just making your custom form and not the driver program then you can directly use the data which is fetched by program.
    For fetching extra info which is standard prog is not fetching you can make use of PERFORM command. Follow below link:-
    [Perform_in_Script|http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm]
    Alignment is done through the proper use of TABS. Refer below link for Alignment issues:-
    [SAP_SCRIPT|http://wiki.sdn.sap.com/wiki/display/ABAP/SAPscript]
    Hope it helps.
    Thanks,
    Daya

  • How to add field value to the standard table

    Hi,
    How to add field value to the standard table?
    for example:
    when we go to TCODE SE16-> VBAK table -> on the selection screen if we press F4 against VBTYP we get all the available values for that field. How to add a new document Category value to this field so that it shows up in F4 help for that field.

    Hi Asif,
    I don't think it is possible and feasible for adding new field value to the field VBTYP because it is not possible through SPRO.
    If u see the domain of this field VBTYP we have fixed values provided by SAP. There is no value table for this. If u have value table then it will be updated through SPRO. But still if u really want to add some value u can do that by getting access key and add the value in the fixed values of the domain. But of no use other than simply displaying in F4. Because for what ever value u created here there will be no documents in VBAK or any table using this domain.
    Hope this is clear for u.
    Thanks,
    Vinod.

  • How to ADD field in iview ?

    hi,
    in portal-iview i want to add a field.
    when i go to 'portal-content -> open the iview with right click -> preview' and then
    do ctrl-alt-right-mouse click i got to the customizing of the fields.
    i know how to HIDE fields there, but i don't know how to add fields ? in the list
    of the fields the necessary fields are available, BUT i only have to options:
    hide -> YES or NOT PERSONALIZED
    any ideas ?
    reg, Martin

    Gopal,
    the root element of this fields does NOT have the option 'decorate'.
    it is the quoata overview of ESS : sap.com/ess~quotas
    the top of the tree has option 'decorate', but this is above the necessary table where
    i select the data.
    my adrl is 
    martin.svik(at)denzel.at
    maybe we can 'change' some screenshots where you can send me yours and i can
    send you mine to explain it in a better way
    reg, Martin

  • How to add fields to already loaded cube or dso and how to fill records in

    how to add fields to already loaded cube or dso and how to fill  it.can any one tell me the critical issues in data loading process..?

    This is sensitive task with regards to large volumes of data in infoproviders.
    The issue is to reload of data in case of adjusted structures of infoproviders.
    Indeed there are some tricks. See following:
    http://weblogs.sdn.sap.com/cs/blank/view/wlg/19300
    https://service.sap.com/sap/support/notes/1287382

  • How to add spaces at the end of record

    Hi Friends,
    i am creating a file which contains more than 100 records.
    In ABAP i have internal table with on field(135) type c.
    some time record have length 120, somtime 130 its vary on each record.
    but i would like to add space at the end of each record till 135 length.
    Can you please help me how to add speace at the end of record.
    regards
    Malik

    So why did you said that in your first posting? My glass sphere is out for cleaning...
    Instead of type c use strings and add spaces until they have the appropriate length.
    loop at outtab assigning <pout>.
      while strlen( <pout>-val ) < 135.
        concatenate <pout>-val `` into <pout>-val.
      endwhile.
    endloop.

  • HOW TO ADD FIELDS OF BSEG-ZFBDT & BSEG-ZBD1T

    hi frnds.
    currently iam working on SD MODULE I NEED the NET DUE DATE SO HOW TO DO THAT
    1 problem plz:
    HOW TO ADD FIELDS OF BSEG-ZFBDT & BSEG-ZBD1T
    TOGETHER
    one is date & other is numeric value so how?
    one is date & other is numeric value so how to add this 2 fields
    & finally i want to display the o/p in date format dd/mm/year
    THANKS IN ADVANCE.

    Hi Mahesh,
    one of the nice features of ABAP is that it takes care about month/year changes when adding days/month on a date.
    ADD lv_zbd1t TO lv_zfbdt.
    This should work fine. If not, try to convert zbd1t into an integer first.
    To get you preferred date output format try this:
    DATA: lv_datestring TYPE string.
    CONCATENATE lv_zfbdt+6(2) '/' lv_zfbdt+4(2) '/' lv_zfbdt(4)
    INTO lv_datestring.
    This isn't tested, but should give you a clue.
    Regards,
      ok

  • Add fields to the standard report QM15

    i want to add fields to the standard report.
    t.code QM15 which display the list of items: selection of notifications.
    the fields i want to add are:
    1. batch no
    2. Sample no
    3. Main vendor
    please let me know how can i do this. if any one can help me with screenshot doc. this is really helpful.
    Thanks

    Hi experts,
    I have done with the z** creation of the standard report. I also create the z*include for the standard includes which are in the standard program. But I not able to find the fieldcatlog or include where I can add my new fields.
    But I tried with one structure tht is standard structure in tht standard report so i make it as z*structure and I append my new fields to this structure. I debug the report and this works fine and also shows output, but at output when I change the layout to see these new fields it shows dump.
    Then I tried with one more thing to give the positioning to my new added fields. (This is what u can say column positioning ).
    When I execute this,it goes to dump screen.
    Now I don't what to do with this.
    If any one like to see the code. Plz let me know I will post the code.
    Or if any one have any document on this plz share. Or any other solution.
    Thanks in advance.
    Thanks
    Sachin

  • Hi,How to add field to sap Liquidity calculation module tables?

    Hi Experts,
            How to add field to sap Liquidity calculation module tables?
            and how to add a field to a particular transaction code using a customer exits.
    please tell me in detail.
    thanks inadvance,
    Regards,
    Rekha

    Hi Pranab,
    Please follow the below steps to create an extra field and write code for that field through Infoset.
    1-->Change in Infoset
    u2022Go to SQ02 , enter Infoset name and click on Change Button
    u2022Go to Extras (F5) button displayed on application bar.
    u2022In Extras tab, click on 'Create' icon to create additional field E_NAME1, give as type C (character) and give desired length and. Enter header description  as 'ShipToName'
    u2022Select this field i.e E_NAME1 in one of the field group of Infoset.
    u2022Go to Code section  (Shift+F8) of infoset, Select Record Processing Event and write your logic code (condition) in this code section:
    if vbpa-adrnr = space.
    E_NAME1 = kna1-name1.
    else.
    E_NAME1 = adrc-name1.
    endif.
    2-->Generate the Infoset.
    3-->Change in Query
    u2022Go to SQ01(in a new session), give your query name (by selecting your user group) and click on change button.
    u2022Check the field group in which you have added E_NAME1 field, then check E_NAME1 from Fields screen
    u2022Click on 'Basic List' button; give line (row no.) and sequence (column no.) for extra fields.
    u2022Execute/Test the Query, you will get desired result.
    Please let me know, if you need more information.
    Regards,
    Dinesh
    Edited by: Dinesh Tiwari on Oct 29, 2009 7:13 AM

  • How to add marker on the clip?

    Hi!!!
    Could you help me, how to add marker on the clip? Not on the sequence. I need the marker to moving as I moving clip in the sequence.
    Thanks!!!

    Ohhh... I just had to switch to the source monitor. OK. Just I don't use the source monitor usally. Only the program one. Thank you. It worked!
    Fri, 12 Oct 2012 05:02:08 -0600 от Jim Simon <[email protected]>:
    >     
    >
        Re: How to add marker on the clip?
        created by Jim Simon in Premiere Pro CS5, CS5.5, & CS6 - View the full discussion

  • How to add request in the buffer

    Hii All,
    How to add request in the buffer in bulk.
    i am using following command.
    tp addtobuffer requestno <sid>
    but after doing it is giving me the following error
    C:\usr\sap\trans\bin>tp         addtobuffer     BWDK900161      BT1
    ^CThis is tp version 340.07 (release 640, unicode enabled)
    E-TPSETTINGS could not be opened.
    EXIT
    ERROR: System : Parameter SAPEVTPATH not set. Batch jobs cannot be started.
    Error in TPSETTINGS: transdir not set.
    tp returncode summary:
    TOOLS: Highest return code of single steps was: 0
    ERRORS: Highest tp internal error was: 0208
    tp finished with return code: 208
    meaning:
      error in transportprofil (param missing, unknown,...)
    Pls help.
    Regards,
    Viren.

    Hi Rolf,
    thax for your reply.
    But still it is not working it shows following message.
    C:\usr\sap\trans\bin>tp addtobuffer BWDK900051 BT1 pf=c\usr\sap\trans\bin\TP_DOM
    AIN_BT1.PFL
    This is tp version 340.07 (release 640, unicode enabled)
    E-c\usr\sap\trans\bin\TP_DOMAIN_BT1.PFL could not be opened.
    EXIT
    ERROR: System : Parameter SAPEVTPATH not set. Batch jobs cannot be started.
    Error in c\usr\sap\trans\bin\TP_DOMAIN_BT1.PFL: transdir not set.
    tp returncode summary:
    TOOLS: Highest return code of single steps was: 0
    ERRORS: Highest tp internal error was: 0208
    tp finished with return code: 208
    meaning:
      error in transportprofil (param missing, unknown,...)
    Regards,
    Viren.

  • How to add filter in the dist. model

    hi,
    how to add filter in the dist. model
    thanks
    Ruban

    Hi,
    Please try this.
    1. Go to transaction BD64.
    2. Click on Change button.
    3. Expand the corresponding model view.
    4. Expand the corresponding message type (i.e MATMAS).
    5. Place the cursor to 'No filter set' and double click.
    6. Click on Create Filter Group.
    7. Add your filter from here ...
    8. Once done, save the model view.
    For more information, please check this link.
    http://help.sap.com//saphelp_470/helpdata/EN/0b/2a611c507d11d18ee90000e8366fc2/frameset.htm
    Regards,
    Ferry Lianto

  • How to add Acrobat to the Microsoft Office ribbon?

    how to add Acrobat to the Microsoft Office ribbon?

    Hi ebender888,
    What versions of Acrobat and Office do you have? See if this post helps: https://answers.acrobatusers.com/Why-Acrobat-PDFmaker-Office-COM-Addin-tab-disappearnig-Wo rd-Office-2013-q152959.aspx
    If not, let us know what software you're using, and we'll try to get you pointed in the right direction.
    Best,
    Sara

  • HT5654 how to add videos to the ipad using the latest version of itunes

    how to add videos to the ipad using the latest version of itunes ?

    Hello zaraa90,
    After reviewing your post, I have located an article that can help with syncing content. It contains a number of troubleshooting steps and helpful advice for the issue you are experiencing:
    Sync your iPhone, iPad and iPod with iTunes using USB
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

Maybe you are looking for