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: 
Read only

For dynamic columns in smartforms

former_member187748
Active Contributor
0 Likes
2,487

Hi all,

i have a requirement that in my smarform shown in screenshot, i have various values of

quotataion no for a single value of PR. But as you can see i can only able to show six set

of quotation in my smartforms which i can print in A4 size paper.

But my requirement is that if i will get more than six values of quotation no.(ebeln),

then i can print it in A3 size paper, but for the same purpose i will need dynamic column .

I have searched various thread in this forum but didn't get my answer.So if anyone can sujjest me what

what changes i have to perform for the same purpose, as in screenshot i have got one set of values

for single values of  "ebeln", but i don't know how could i do to get for multiple values of  "ebeln",

and what if my quotation value will exceeds more than six.

1 ACCEPTED SOLUTION
Read only

rosenberg_eitan
Active Contributor
0 Likes
1,682

Hi,

It look like an internal form so I suggest you tell your

people that the form can be redesign so all the variable columns will become rows

this way the cost of development and complexity can be reduces dramatically .

Also you will be saving paper (Be greener) since you will able (from my impression) to print more then 6 quotations on the same page.

Regards.

8 REPLIES 8
Read only

rosenberg_eitan
Active Contributor
0 Likes
1,683

Hi,

It look like an internal form so I suggest you tell your

people that the form can be redesign so all the variable columns will become rows

this way the cost of development and complexity can be reduces dramatically .

Also you will be saving paper (Be greener) since you will able (from my impression) to print more then 6 quotations on the same page.

Regards.

Read only

Former Member
0 Likes
1,682

Hi Sanjeev,

Capture all Field Name into Internal table , I mean ITAB1 is One Set of Field's , ITAB2 is Second Set Of Field and these Internal tables passed into smartforms as per your condition .

Example :

If Condition A= B

  Use ITAB1  Field Names.

ELSE.

  Use ITAB2   Field names .

endif .

Regard's

Smruti

Read only

0 Likes
1,682

Hi Smruti,

can you please tell me clearly how could i will achieve, because let i have six records in first

conditions, and ten records in my second conditions, now i have to use commands to fetch all

the values in its respected fields......so i have to use different variables in commands for each values

of quotation no or i can acheive it through a single variable based on conditions.

Here is the code of my driver program where  i have selected each field.

Can you please sujjest me how could i write my program to achieve this

SELECT BANFN

        EBELN

        FROM EKET

        INTO CORRESPONDING FIELDS OF TABLE IT_EKET

        WHERE BANFN IN S_BANFN.

*BREAK abap.

IF IT_EKET[] IS NOT INITIAL.

   SELECT EBELN

          WAERS

          ANGDT

          ZTERM

          LIFNR

          BUKRS

          FROM EKKO

          INTO CORRESPONDING FIELDS OF TABLE IT_EKKO

          FOR ALL ENTRIES IN IT_EKET

          WHERE EBELN = IT_EKET-EBELN

          AND BSTYP = 'A'.

IF SY-SUBRC NE 0.

IF IT_EKKO IS INITIAL.

   MESSAGE 'No suitable records exists for given Indent Number' TYPE 'E'.

   LEAVE LIST-PROCESSING.

ENDIF.

ENDIF.

IF SY-SUBRC = 0.

*ELSEIF IT_EKKO IS NOT INITIAL.

SELECT   EMATN

          TXZ01

          KTMNG

          MEINS

          NETPR

          ZWERT

          EBELN

          MWSKZ

          FROM EKPO

          INTO CORRESPONDING FIELDS OF TABLE IT_EKPO

          FOR ALL ENTRIES IN IT_EKKO

          WHERE EBELN = IT_EKKO-EBELN.

SELECT BADAT

        BANFN

        FROM EBAN

        INTO CORRESPONDING FIELDS OF TABLE IT_EBAN

        FOR ALL ENTRIES IN IT_EKET

        WHERE BANFN = IT_EKET-BANFN.

SELECT EVRTN

        KNUMH

        FROM A016

        INTO CORRESPONDING FIELDS OF TABLE IT_A016

        FOR ALL ENTRIES IN IT_EKKO

        WHERE EVRTN = IT_EKKO-EBELN.

SELECT KNUMH

        KBETR

        KSCHL

        FROM KONP

        INTO CORRESPONDING FIELDS OF TABLE IT_KONP

        FOR ALL ENTRIES IN IT_A016

        WHERE KNUMH = IT_A016-KNUMH.

SELECT BUTXT

       BUKRS

       FROM T001

       INTO CORRESPONDING FIELDS OF TABLE IT_T001

       FOR ALL ENTRIES IN IT_EKKO

       WHERE BUKRS = IT_EKKO-BUKRS.

ENDIF.

**ENDIF.

Read only

Former Member
0 Likes
1,682

You can not have dynamic columns in smartforms.

I think you have posted same query here

Read only

rosenberg_eitan
Active Contributor
0 Likes
1,682

Hi,

Just an idea.

HTML can be generated dynamically.

So you can generate a very nice looking HTML page and ask the user to print it using

the Internet browser.

Regards.

Read only

0 Likes
1,682

Hi Eitan,

thanks for your reply, but i don't want to let user use a html,

our requirement is to make it through smartforms.

Read only

0 Likes
1,682

Hi,

Well the only thing that I am going to say is that I do not envy you on this one.....

Please keep us updated on this development. It will be interesting.....

Regards.

Read only

rosenberg_eitan
Active Contributor
0 Likes
1,682