Skip to Content

How differentiate different data in smartform with foreground and hinterground mode

Hallo Experts,

I have question reagrd smartform in foreground and hinterground mode. When i want a generate form in foreground then print data in smartform in z.b Contact : SY-USNAME. ( hardcord) . Loging User

When a generate formular in hinterground then data " Contact " print from z-table instead SY-USNAME in smartform. In Z-table i have another user. I have this requirement. How is it possible that when generate formular in hintergorund print data from Z-table instead SY-UNAME.

Please give me idea or suggest some code.


This is my code


CALL FUNCTION gv_fm_name

EXPORTING

control_parameters = im_control_para

output_options = im_output_opt

iv_user = sy-user ( Loging User )

IMPORTING

job_output_info = is_output_info

TABLES

lt_vbap = it_data

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.


Thanks




Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Dec 06, 2015 at 07:23 PM

    Hallo Muhammed,

    you can check it if the program is executed in background or foregrond,

    AT SELECTION-SCREEN.

    CASE sy-ucomm.


    WHEN 'SJOB'.

    Select uname from table_ABC into lv_uname where A = A.

    " background processing

    WHEN 'ONLI'.

    " foreground processing

    lv_uname = Sy-uname .

    ENDCASE.

    CALL FUNCTION gv_fm_name

    EXPORTING

    control_parameters = im_control_para

    output_options = im_output_opt

    iv_user = lv_uname ( in foreground , sy-uname, in background , from database)

    IMPORTING

    job_output_info = is_output_info

    TABLES

    lt_vbap = it_data

    EXCEPTIONS

    formatting_error = 1

    internal_error = 2

    send_error = 3

    user_canceled = 4

    OTHERS = 5.



    Regards

    Ebrahim

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.