cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed in Write_form FM

Former Member
0 Kudos

Hello all,

I am learning SAP Scripts.

I am not getting the o/p for the query on the desired Window. I want particular 'Material Number' on 'Main' Window. In write_form FM I have selected 'MAIN' in Window parameter and 'MAIN' in element parameter. I think I had gone wrong in 'element' parameter.Please guide me what to do.

where should I declare element names in Form Painter (SE71)?

Please guide.

Harish

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hello all,

thanks for the help

Former Member
0 Kudos

Hi,

chech this link

http://sapdev.co.uk/sapscript/sapscript_fms.htm

Regards,

Madhu

Former Member
0 Kudos

Hi,

Check in sap script whether you have given the name correctly.

/E test

&itab-bukrs&

Also ensure that you are using the function module start_form before write_form and looping using itab.

Regards,

Deepthi.

Former Member
0 Kudos

Hi Deepthi,

is there looping necessary for only one company code?

I have given parameter in selection screen.End User has to select it from the list.

If I use looping the control is being transferred to selection screen again.

I had used start_form before write_form.

Please guide.

Harish

Former Member
0 Kudos

Hi Harish,

Just try getting the value the user has entered and use it to loop using a where condition.

Hope this helps.

Regards,

Deepthi.

Former Member
0 Kudos

Hi Harish,

Loop at itab.            
call function 'WRITE_FORM'
             exporting
               element                     = 'TEST'
               window                      = 'TEST'
             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.

Regards,

Sravanthi

Former Member
0 Kudos

like create one window with name test.

in your print program call CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'test'

window = 'test'.

goto SE71 open your test window

in text editor call like belwo

/E test

Former Member
0 Kudos

Hello,

I have declared the similar only.

I have uses window name 'test' and declared the text element by name 'test' as

/E TEST.

p1 company code

  • itab-bukrs

Still the o/p is blank.

Write_Form is not picking up anything in above. I have used element as 'test' and window 'test'.

It is not giving any error also but displaying blank screen.

Harish

Former Member
0 Kudos

Hi,

In se71, goto page window, select the window you want to declare the element in , then edit->text elements.

Then you can select goto->change editor.

Now you can define your elements using /E.

In the editor program use write form to call this declared element.

Hope this is useful.

Regards,

Deepthi.