Skip to Content
-1

Smartform issues

Jul 04, 2017 at 12:01 PM

108

avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Bertrand DELVALLEE Jul 04, 2017 at 02:35 PM
0

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

Show 6 Share
10 |10000 characters needed characters left characters exceeded
Former Member

thank you for reply Bertrand

i am taking ''cooler sr. number'' from objk (sernr) and ''serial number'' as a count ,i had tried

what u suggested but still not got succeed .

any another option ??

0

Hello,

What is the problem now :

- T3 is not well filled?

- T3 display is corrupted?

- Other?

0
Former Member

same happens again ,count is printing as ..........'''blank ......3,5,7,9

and cooler serial numbers repeating multiple times

0

Can you please add a BREAK-POINT instruction after the last "endif." and tell us that contains T3 and T1?

( 10 rows should be enought)

0

Bertrand,

This is at least the third time I have seen your answers promoting obsolete programming syntax. You should not be using internal tables with header lines. I know you state that it's with header lines just to simplify but that code will be copied and used. Please update with non-obsolete statements.

0

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.

0
Michał Majer Jul 04, 2017 at 02:00 PM
1

It is propably some bug in Your code / smartform

Share
10 |10000 characters needed characters left characters exceeded