Skip to Content
avatar image
Former Member

form problem

Please use a more meaningful subject in future

gurus

i have created a smartform.

i have one internal table which contains vbeln, matnr, maktx,kunnr,customer address, plant address etc i am passing this to samrtform from application program.

i want to display the address of customer , plant and freight vechicle details at the top in the secondary windows and the item details in the main window.

For every new documnet (vbeln) i want to display it in the new page all the details ie secondary windows and the items and the footer.

kindly tell me how to achive these

Edited by: Matt on May 1, 2009 11:45 AM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 29, 2009 at 03:46 AM

    Hi,

    Follow the steps:

    1. after getting the data to Smartform, create 2 pages.

    2. In General Atrributes of the 1st page, Enter NEXT PAGE as 'ur Second Page name' and now in General Attributes of 2nd page, Enter NEXT PAGE as 'same Second Page name'.

    3. Now create the Windows whichever you want to display in 1st page (i.e., Address Window, Footer Window, Header Window).

    4. by creating windows in first page it will automatically come in 2nd page also, so here delete the windows whichever you dont want to display (i.e, if u dont want to display Address Window just delete the window from 2nd page).

    Inside the LOOP add code lines (like, for every new VBELN set a flag = X). Now call a COMMAND below the code lines & check the check box 'Go to New Page' select ur FIRST page name in Pick box.. and in Conditions tab (give 'flag = 'X' & sy-tabix # 1).

    Hope it helps!!

    Rgds,

    Pavan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Ramesh,

      What was a very simple question from your side got turned into a novel.

      The idea is:

      you sort the internal table by vbeln.

      you have a loop on vbrp or whatever.

      you store the vbeln that was in the last iteration, for example:

       lv_last_vbeln = ls_line-vbeln . 

      This code should be the last thing in your loop.

      Inside the loop, before writing the texts you wanted , you have an if with the following condition:

      lv_last_vbeln <> ls_line-vblen.

      If it's true, you call that command. You don't need a zilion new pages for this, only one, maximum 2 if you want the first page to be different from the rest(to have more header texts, for example) .

      The command should be Go to new page: LAST_PAGE (not the first one).

      Please make sure that the page change does not happen before the first record and after the last (not to have a blank page at the beginning or at the end). I'm sure you can figure out on your own how to do this.

      Let us know if you have further issues.

      Best regards,

      George

  • avatar image
    Former Member
    Apr 28, 2009 at 04:00 PM

    Hi Ramesh,

    You can archive this by y creating a command line

    in the smart form.

    This is how you create.

    create->flow logic->command

    when you create that command in the window in the right side you have check box

    'Go to New page' check that and from the dropdown box select the page you want

    Regards,

    Jaya rama kumar

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      thank you gurus for the reply.

      I still wonder how to acheive this.

      I have a table it_display.

      i created 4 secondary windows.

      now i created a table in the main window.

      loop at it_display into w_display

      header

      main area

      ->here i will display all the item details of the sales order numeber

      footer.

      so please tell me for the next sales order also i need to display like above.

      how to acheive this

  • avatar image
    Former Member
    Apr 28, 2009 at 03:43 PM

    hi,

    by using EXPORT to Memory

    and Import from Memory.

    Regards,

    Prabhudas

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 28, 2009 at 11:05 PM

    Hello Ramesh,

    U are getting a single internal table IT_ALL from the driver program, Loop the internal table to capture the header data into other internal table in the smartform which will have unique records for the each VBELN, assume table IT_HDR. VBELN will be common in the both tables, which you can link in the later part.

    You can create a single main window and in it, you can create templates with boxes and shades, when it prints out it looks like as an separate windows.

    Loop the IT_HDR table. Inside the loop use the Command option to trigger the new page and you need have condition for it, not to trigger for the first time and also you need to have logic to check VBELN is changed or not. IF changed page break will be triggered.

    Print all header data in the respective templates accordingly.

    In the main window you will have table, in that specify the IT_ALL and link it with the IT_HDR with VBELN. You will be printing only those line items of the vbeln.

    Once Line items are done. Then the footer.

    Add comment
    10|10000 characters needed characters exceeded

  • May 01, 2009 at 09:45 AM

    Please use a more meaningful subject in future

    Add comment
    10|10000 characters needed characters exceeded