Skip to Content
avatar image
-1
Former Member

Smartform issues

Hello Guys,

In Smartform , when i Print Single column of Serial numbers and its corresponding invoice numbers all working well but when i try to print multiple column of serial number and invoice number on same line type in table control,all numbers gets repeat and serial numbers also not in sequence ,

and also if quantity/po is 23 then 23 serial number need to update and rest will be blank

I have attached both the snap PFAcapture2.pngcapture.png

Please help me out !!!!

capture2.png (26.1 kB)
capture.png (29.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 04, 2017 at 02:35 PM

    Hello,

    Here is how I would deal with it :

    - Lets consider your old table is named T1 with fields "serial" and "value"

    - Create a local data table with 6 columns (let call it T3) : serial1, value1, serial2, value2, serial3, value3

    - Before table node, in the same folder, create a logical ABAP with in input : your old table ("T1"), in output "T3"

    Put a code like this :

    DATA w_mod TYPE p.
    CLEAR t3.
    FIELD-SYMBOLS <l1> LIKE LINE OF t1.
    DATA l3 LIKE LINE OF t3.
    CLEAR l3.
    LOOP AT t1 ASSIGNING <l1>.
      w_mod = sy-tabix MOD 3.
      IF w_mod = 1.
        l3-serial1 = <l1>-serial.
        l3-valuel1 = <l1>-value.
      ELSEIF w_mod = 2.
        l3-serial2 = <l1>-serial.
        l3-valuel2 = <l1>-value.
      ELSE.
        l3-serial3 = <l1>-serial.
        l3-valuel3 = <l1>-value.
        APPEND l3 TO t3.
        CLEAR l3.
      ENDIF.
    ENDLOOP.
    IF l3 IS NOT INITIAL.
      APPEND l3 TO t3.
      CLEAR l3.
    ENDIF.
    
    

    - Display T3 instead of T1

    Best regards

    Bertrand

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Richard,

      I'm not promoting anything, I write understandable abap/pseudo code centered on a solution and explaining how it works. I'm not answering "please copy/paste". Moreover here we don't even know the tables names and fields.

      Header line I may used in some of my answers are in a context. TABLE parameter may be obsolete in FM and Smartforms interface but it still used by standard. For example, when you deal with IDOC there are template FM that you have to copy in Z* and they contained TABLE parameters. Of course you can then ignore the header line functionality in your code. I do. But doing so you can't reuse standard example codes.

      Header line is evil : don't use it. Answer edited.

  • Jul 04, 2017 at 02:00 PM

    It is propably some bug in Your code / smartform

    Add comment
    10|10000 characters needed characters exceeded