Code for looping the write_form

Hi
can anyone give me the code that  u have developed inthe past for looping the write_form F.M. please...

Hi,
TABLES :
  scarr,
  spfli,
  sflight.
*PARAMETERS :
*  p_carrid LIKE sflight-carrid,
*  p_connid LIKE sflight-connid.
DATA :
BEGIN OF fs_sflight,
   carrid LIKE sflight-carrid,
   connid LIKE sflight-connid,
   fldate LIKE sflight-fldate,
   price  LIKE sflight-price,
   currency LIKE sflight-currency,
   seatsmax LIKE sflight-seatsmax,
   seatsocc LIKE sflight-seatsocc,
END OF fs_sflight.
DATA :
  t_scarr LIKE
STANDARD TABLE
       OF scarr.
DATA :
   t_spfli LIKE
  STANDARD TABLE
        OF spfli.
DATA :
  t_sflight LIKE
   STANDARD TABLE
         OF fs_sflight.
DATA :
  fs_options TYPE itcpo.
START-OF-SELECTION.
  PERFORM selection.
  PERFORM open_form.
  LOOP AT t_sflight INTO fs_sflight.
    AT NEW connid.
      PERFORM start_form.
      READ TABLE t_spfli INTO spfli WITH KEY carrid = fs_sflight-carrid
                                             connid = fs_sflight-connid.
      READ TABLE t_scarr INTO scarr WITH KEY carrid = fs_sflight-carrid.
    ENDAT.
    PERFORM write_form.
    AT END OF carrid.
      PERFORM end_form.
    ENDAT.
  ENDLOOP.
  PERFORM close_form.
*&      Form  selection
*       text
*  -->  p1        text
*  <--  p2        text
FORM selection .
  SELECT *
    FROM scarr
    INTO TABLE t_scarr.
*          WHERE carrid = p_carrid.
  SELECT *
    FROM spfli
    INTO TABLE t_spfli.
*          WHERE carrid = p_carrid
*            AND connid = p_connid.
  SELECT carrid
         connid
         fldate
         price
         currency
         seatsmax
         seatsocc
    FROM sflight
    INTO TABLE t_sflight.
*   WHERE carrid = p_carrid
*     and connid = p_connid.
ENDFORM.                    " selection
*&      Form  open_form
*       text
*  -->  p1        text
*  <--  p2        text
FORM open_form .
  fs_options-tdcopies = 2.
  fs_options-tddest = 'LP01'.
  fs_options-tdpreview = 'X'.
  fs_options-tdnoprint = 'X'.
  CALL FUNCTION 'OPEN_FORM'
   EXPORTING
*   APPLICATION                       = 'TX'
*   ARCHIVE_INDEX                     =
*   ARCHIVE_PARAMS                    =
*   DEVICE                            = 'PRINTER'
   dialog                            = ' '
*     form                              = 'FORM1'
*   LANGUAGE                          = SY-LANGU
   options                           =  fs_options
*   MAIL_SENDER                       =
*   MAIL_RECIPIENT                    =
*   MAIL_APPL_OBJECT                  =
*   RAW_DATA_INTERFACE                = '*'
* IMPORTING
*   LANGUAGE                          =
*   NEW_ARCHIVE_PARAMS                =
*   RESULT                            =
   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.
ENDFORM.                    " open_form
*&      Form  write_form
*       text
*  -->  p1        text
*  <--  p2        text
FORM write_form .
  CALL FUNCTION 'WRITE_FORM'
   EXPORTING
     element                        = 'FLIGHTINFO'
*   FUNCTION                       = 'SET'
*   TYPE                           = 'BODY'
*   WINDOW                         = 'MAIN'
* IMPORTING
*   PENDING_LINES                  =
   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.
    WRITE 'Write_Error'.
  ENDIF.
ENDFORM.                    " write_form
*&      Form  close_form
*       text
*  -->  p1        text
*  <--  p2        text
FORM close_form .
  CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
*   RESULT                         =
*   RDI_RESULT                     =
* TABLES
*   OTFDATA                        =
* 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.
ENDFORM.                    " close_form
*&      Form  start_form
*       text
*  -->  p1        text
*  <--  p2        text
FORM start_form .
  CALL FUNCTION 'START_FORM'
   EXPORTING
*   ARCHIVE_INDEX          =
     form                   = 'FORM1'
*   LANGUAGE               = ' '
*   STARTPAGE              = ' '
*   PROGRAM                = ' '
*   MAIL_APPL_OBJECT       =
* IMPORTING
*   LANGUAGE               =
   EXCEPTIONS
     form                   = 1
     format                 = 2
     unended                = 3
     unopened               = 4
     unused                 = 5
     spool_error            = 6
     codepage               = 7
     OTHERS                 = 8
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " start_form
*&      Form  end_form
*       text
*  -->  p1        text
*  <--  p2        text
FORM end_form .
  CALL FUNCTION 'END_FORM'
* IMPORTING
*   RESULT                         =
   EXCEPTIONS
     unopened                       = 1
     bad_pageformat_for_print       = 2
     spool_error                    = 3
     codepage                       = 4
     OTHERS                         = 5
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " end_form
Regards,
Swapna.
Edited by: NagaSwapna Thota on Jul 4, 2008 9:14 AM

Similar Messages

  • T.code for check the Total SRS

    pls tell me t.code for match the SRS (stock requitions slip)from store  or production ?
    Thanks
    Rekha Sharma

    U can check in MB25 or in MB51.

  • Wanted to update the software now available, but it is asking for a pass code. As far as I remember in didn't put in any pass code , how do I settle this issue . Earlier updates were asking Apple ID but pass code for updating the new soft ware not known.

    Wanted to update the software now available, but it is asking for a pass code. As far as I remember in didn't put in any pass code , how do I settle this issue . Earlier updates were asking Apple ID but pass code for updating the new soft ware not known.

    Hello Kewal,
    Thank you for the details of the issue you are experiencing when trying to perform an update.  I recommend trying to update using iTunes, and as always, it is a good idea to make a backup first. 
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/ht1766
    Update your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/ht4623
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Transaction code for checking the capacity of  a job

    Hi,
      Can anybody tell me if there is a transaction code for viewing the capacity of Job.
    Thanks and regards,
    Avinash.S

    Hi Avinash,
    I am not geeting what you want normally CM01 for w/c vise Load you can use.
    Pls elaborate yr problem a little bit.
    Umesh

  • How can we write the code for opening the command prompt and closing the

    how can we write the code in java for opening the command prompt and closing the cmd prompt from eclipse (cmd prompt should close when click on the turminate button in eclipse)

    rakeshsikha wrote:
    how can we write the code for opening the command prompt and closing theBy typing in Eclipse (which you seemingly have)?

  • T-Code for changing the default Exchange Rate reference for creating PO?

    Dear All,
           Can somebody kindly give me the T-Code for changing the default
    Exchange Rate reference for creating PO? Is there a Step by Step
    procedure before changing the default exchange rate?
    Thank you in advance.
    Regards,
    Gopesh

    Hi
    There is not such Tcode to change the default exchange rate from the PO.
    If you want you can confugure the exchange rate in the following path in the IMG,
    SPRO>MM>LIV>Incoming Invoice>Configure How Exchange Rate Differences Are Treated
    Hope it helps you.
    Cheers
    Umakanth

  • T.Code for checking the total value of a material

    Hi Experts,
      Can anybody tel me the T.code for checking the total value of a material which is procured in a specified period?
    Thanks in advance
    Channa

    Refer Tcode ME80FN click on Change Veiw & select Purchase Order History with this you can get PO-GRN-INVOICE Qty & Value details
    Last button on Application tool Bar it is in line of filter, total etc icons
    Also check below reports :
    MC$G - PURCHIS: Material PurchVal Selection
    MC$0 - PURCHIS: PurchGrp PurchVal Selection
    MC$< - PURCHIS: MatGrp PurchVal Selection
    MC$4 - PURCHIS: Vendor PurchVal Selection

  • What is the transaction code for see the Web Services available in SAP

    Hi
    I came to know that SAP has provided its own webservices... I need some information on that... If any one has documentation on that can u please send it to me... My ID is <b>[email protected]</b>.
    What is the trasaction code for see the web services available in SAP.... Can any one help.. Please its  urgent
    Best Regards
    Ravi Shankar B
    Message was edited by:
            RaviShankar B

    Hi,
    you can find Web Services (Enterprise Services) in the Enterprise Services Workplace (ES Workplace). The ES Workplace allows you to explore, test, and use enterprise services to make enterprise SOA tangible. Here, you will find all of the currently productized enterprise services by SAP.
    Best Regards,
    Boris Mueller
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/developerareas/esa/esapreview">ES Workplace at SDN</a>
    <a href="http://esapreview.sap.com:82/socoview(bD1kZSZjPTgwMCZkPW1pbg==)/flddisplay.asp">ES Workplace</a>

  • What is the T-code for Viewing the Payment Advices....

    Hi,
    What is the T-code for Viewing the Payment Advices....
    Regards
    Sap Guru

    Hi,
    Payment advice creation - FBE1
    Payment advice Change - FBE2
    Payment advice Display - FBE3
    Payment advice Delete - FBE6.
    Assign points if helpful.
    Thanks,
    Vasu..

  • Transaction Code for seeing the files in the  Application Server

    Hello All,
      Can anybody please give me the transaction code for seeing the files in the Application Server
    Thanks in Advance,
    Regards,
    LIJO.

    hi
    good
    try with tcode AL11.
    thanks
    mrutyun^

  • HT1539 Why Do I keep getting an error message telling me "Code redemption is temporarily unavailable. Please try again later." whenever I try to redeem my digital copy code for "Oz The Great and Powerful"?

    Why Do I keep getting an error message telling me "Code redemption is temporarily unavailable. Please try again later." whenever I try to redeem my digital copy code for "Oz The Great and Powerful"?

    I had the same problem so I decided to try going to website on the back. (DisneyOzMovieandOffers.com). It will take you to a page that says to redeem code, enter the code that is given to you and click enter. It will give you options of where you would like to download it from. Click iTunes and it will give you the correct code to download the movie from iTunes.

  • Code for displaying the word doc file from servlet as response.

    Hi can any provide me code for displaying the word document form servlet as response.
    here i have file from file it should ale to read them and display it.
    i have written code but the proble here is in displaying.it ios as not showing as word.can any one help me here
    vijay

    Are we talking of HTTP?
    If yes, you'll need to provide an appropriate content-type and use the binary output stream.
    IE does not trust the content-type header but relies upon the file name, so set it too.
    response.setHeader( "Content-Disposition", "attachment; filename=" etc. Edited by: BIJ001 on Oct 22, 2007 10:10 AM

  • Code for repositioning the borders in SFP

    Hello Forum,
    Could someone help me with the code for repostioning the borders in SFP?
    Thanks
    Best Regards
    D. Swathi

    Hi Swathi,
    Are you asking about the page border repositioning. Follwing is the code to reposition any UI Element on the form.
    The code is in FormCalc and Java Script and you have to write it in the form's Script editor. Write the code in the event of the UI element you want.
    To set Margins use follwing:
    Margins
    Left
    leftInset property
    Subform1.margin.leftInset = "measurement"
    Right
    rightInset property
    Subform1.margin.rightInset = "measurement"
    Top
    topInset property
    Subform1.margin.topInset = "measurement"
    Bottom
    bottomInset property
    Subform1.margin.bottomInset = "measurement"
    Size and Position
    X
    x property
    Subform1.x = "measurement"
    Y
    y property
    Subform1.y = "measurement"
    Width
    w property
    Subform1.w = "measurement"
    Height
    h property
    Subform1.h = "measurement"
    Width Auto-fit
    minW property
    Subform1.minW = "measurement"
    Height Auto-fit
    minH property
    Subform1.minH = "measurement"
    Hope it will help.
    Regards,
    Vaibhav Tiwari.

  • Code for displaying the elements of ArraList and HashMap

    hi..im new to java ..
    tell me the code for displaying the elements of ArraList and HashMap

    myj-ava wrote:
    wt abt displaying the elments of HashMap?plz..give clear codehey, this is not a code-giving service. This is a forum of volunteers who help others who have specific questions. I find that the greatest help is given to those who have shown that they've put in at least some effort. You have shown none. Please look at the Sun tutorials first, then come back with a specific question if anything there confuses you.

  • Do you know the T-Code for clearing the A/P check?

    Hi Everybody,
    Do you know the T-Code for clearing the A/P check? 
    For example, we issue a check to vendor for payment.  When the check was cash, the bank will send us the statement for the cleared checks.  Currently, they sent us the diskettes or files to download the cleared checks.  We then upload into SAP.  The T-Code are ZBACK & ZEBCK.
    Usually, we had no problem.  Cleared checks were uploaded in SAP & we were done.  However, there was one check that could not upload in SAP because the check number was wrong (there was one digit missing from the check number sequence).  Is there a T-Code that we can bring up the check number & clear them?

    Hi
    You can use the tcode FEBA to post process the bank statement and manually pick up the open item and clear it.
    Thanks
    Ashok

Maybe you are looking for

  • How do i transfer my itunes account from one computer to another?

    i got a laptop a while back. i have an itunes account on our home computer, but want to transfer it to my own laptop. is there an easy way for me to do this? because i lost all my songs when i accidenly plugged in my ipod to the laptop.. how can i ge

  • How to use "Find my iPad"?

    When you locate a device using Find My iPhone app, I type a message and it sends the message to the device. It also shows on my computer the location. My question is this: Once this is done, I can move my device to another location, turn it off or ke

  • Scheduled Tasks - Administrator Best Practices

    Hi all, I've gotten assistance this week with a couple scripts and scheduling them as tasks. I actually have well over a dozen running on our Exchange server using a special user with a complex password. This user is not used for logging into any mac

  • Solaris Install dissapointing

    I installed Solaris 9 and 10 beta and was hoping the latest release would be better. I was dissapointed. It is exactly the same hardware and yet Solaris 10 won't install. After trying 4 times I gave up and downloaded ubuntu. I was up and running with

  • Solution manger upgrade to ehp1 from 7.0

    Hi we have solution manger 7.0 on windows 2003 with db2 9.1 database. I want to upgrade to ehp1. I mainted the solutionmanger 7.0 sp17 for the upgrade. I started the upgrade first ASJAVA using jspm with stack. First it upgraded the kernel 701. immedi