Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Split forms

former_member194669
Active Contributor
0 Kudos
486

All,

I have the following requirement

We have Z custom SAP scripts and Smartforms that has been designed for usage of multiple company codes. ie 1 form has been used for multiple company codes for single output type.

Now my requirement is to create separate forms for each company code WITHOUT creating new output types.

Here all my driver programs are in Z programs

I am thinking of creating a Z table with fields such as output type, Company Code, and Form Names. and form names were maintained in this table based on output type  for each company code.

Then before calling OPEN_FORM or START_FORM or SSF_FUNCTION_MODULE_NAME needs to look into the above Z table and get the form name based on Output Type Company Code and applied to OPEN_FORM, START_FORM or SSF_FUNCTION_MODULE_NAME.

Please provide your expert opinion on this

Or if you expert having better options please provide info.

Thanks

aRs

1 ACCEPTED SOLUTION

Former Member
0 Kudos
397

Hi,

The proposed solution will work fine for your requirement.

May be you can add one more field in the Z table named 'Form Type', to store wether the form is Script or Smartform.

And in the driver program you can simply check the form type to call either SSF_* or OPEN_* and pass the name.

4 REPLIES 4

Former Member
0 Kudos
398

Hi,

The proposed solution will work fine for your requirement.

May be you can add one more field in the Z table named 'Form Type', to store wether the form is Script or Smartform.

And in the driver program you can simply check the form type to call either SSF_* or OPEN_* and pass the name.

Former Member
0 Kudos
397

Nothing wrong with the way you have mentioned but I will suggest you can opt for satandard way using T-Code STVARV. You can maintain the entries here and put a select query in your program. this is common practice we are following. This maintains entry in table TVARV.

Even you can put all this form fetching logic in a function module and call your function module in driver program. Your function module will return form name based on company code.

BR,

Prakash

0 Kudos
397

I am not sure about maintaining the forms name unique in TVARV table.


I am preferred to do with custom table like

 

Field NameTypeLengthDescription
KSCHLCHAR4Output Type
BUKRSCHAR4Company Code
FTYPECHAR1Form Type
  SCRIPT/SMARTFORMS
FNAMECHAR40script Name or
  SMARTFORM Name

Thanks

aRs

0 Kudos
397

Hi,

Since we are using this in custom driver programs, using a custom table as you have mentioned will be more simple and flexible solution.