cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding serial numbering in smartforms

satvik_panchal
Participant

Hello,

Please refer below sample Output in smartforms :

Sr No. Prd code Case No.

1 prd1 001

2 prd2 002

3 prd3 003

3 prd4 003

I have sorted the items by Case No.

For serial number, I have defined one counter gv_counter.

The code snippet is as given below:

ON CHANGE OF wa_casedetail-exidv.

  gv_counter = gv_counter + 1.

ENDON.

Now the problem is coming in Case No.003 which has 2 Products. So Sr.No. 3 is repeating 2 times in the output. But 3 should be displayed only once for multiple items in same Case No. So what changes should be made in the code. Kindly comment.

Thanks,

Accepted Solutions (0)

Answers (1)

Answers (1)

hedvig_rohonyi
Employee
Employee
0 Kudos

Hello,

could you please check whether the content of the field wa_casedetail-exid (I suppose it contains only the Case No) has been changed since the last time the statement ON CHANGE OF was executed. By the way this command is obsolete and it is better to use auxiliary variables and command IF, Case ...

Best regards,

Hedvig

satvik_panchal
Participant
0 Kudos

Hello,

Sorry for the delay. Can u provide some sample code snippet to be used instead of ON CHANGE OF statement for the above scenario.

Thanks,