Skip to Content
author's profile photo Former Member
Former Member

How give Company code and its text only once in smartform

Dear Freinds,

I have developed the smartform. I have created in my smartform a template and table. My intention of template is to

display only one time after the heading of my company name . In my table i hve gvien all the data which i require from different infotypes i have gathered in my driver program ( i.e reading all the data from diffent infotype and i have put in one internal table and this internal table i have defined a Structure in SE11 )

My Structure in se11 has z_emp_detials

PERNR PERSNO NUMC 8 0 Personnel number

NAME PAD_CNAME CHAR 80 0 Complete Name

CCode bukrs CHAR 4 0 Company code

CCode zbukrs CHAR 40 0 Company code text

Zplans Zplans CHAR 25 0 positions

Now i have declared as

data :it_final type standard table of z_emp_detals.

i have passed the final internal table to my smartform

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'EMP_DETAIL'

IMPORTING

fm_name = fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL FUNCTION fm_name

  • EXPORTING

  • v_totamt = v_totamt

TABLES

  • it_pa0008 = it_pa0008

it_final = it_final.

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

IF sy-subrc <> 0.

  • error handling

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Now iin my smartform ihave declared in the form interace as it_final type standard table ofz_emp_details.

iam getting the data in my outtput for one record ...but my problem is now i wanted to give the company code and its text only

once so i have created template above my table in smartform .and given the company code and its text in the template ...and how i can pass only ontime the ccompany even for all the deails which i have for that company in my internal talbe it_final only once ??? even though on the selection screen user may sellect multiple range of company codes .

My smart form output should be for one company code i should get all the employee details and one andother compnay code the other set of employees.

can any one guide me .

regards

divya

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 18, 2011 at 10:07 AM

    Hi,

    do you intend to run a different smartform for each company code? or you want same smartform , with new company code ddetails on each page?

    you can create a folder and add page protaction to it.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi,

      i think your concern is , how to print a new company code in the template, and print only its details below it in the table. ans so on for each company code.

      1)You can keep teh multiplke company codes in a seperate internal table.ANd loop on it inside your table.

      2) You can add the company code a sa seperate column in your final internal table, and assign the values to respective rows.

      i would suggest, instead of creating a template, create a seperate table line in the table header for printing your company code.

  • Posted on Jul 18, 2011 at 11:16 AM

    Dear Divya,

    If i understand correctly your requirement is to display page by page details of employees pertaning to one company code wth the page header details changing on every company code change. If this is required kindly follow below:

    1.Get the values of all the company code in a internal table and pass to smartforms interface.

    2. Loop the Header Templete on basis of company code and within this loop keep your main table with condition comp code = templete comp code.

    3. This way smartform will start a new loop on company code change and the main data table would be a loop within this loop.

    Do revert in case clarification is required

    Regards

    Abhinav

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 18, 2011 at 11:17 AM

    Hi,

    Don't insert the company code in the table.

    Just keep it as a one more input variable into the smart form.

    Just do loop the program based on the different company codes.

    For each company code call the smart form with the details based on the company code.

    If helpful reward points.......

    Kruthik.

    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.