Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Iam struc with logic on ---ON CHANGE Of

Dear freinds

i have the scenario as follows

JobNo. OrgId ORG DESC

101 1001 SMT1

102 1002 ENF

101 1003 SMT2

They have told me while displaying ORG DESC as the first two characters only

so i have to consider instead of SMT1 i have to take SM only.

Now the requirement is if i have the first two letters as SM (for ex ) of the above

example i have to consider only once the job No. and display against it in output

as 2

so my output should come as ( i have to take only orgdesc instead of orgid in output)

job no orgdesc count

101 SM 2

102 EN 1

iam using the code as below ...but iam not able to increment the count can

please correct my code below

loop at fp_i_temp_job_org into l_wa_temp_job_org.

ON CHANGE Of l_wa_temp_job_org-orgabv .

v_index = v_index + 1.

l_wa_temp_new-jobid = l_wa_temp_job_org-jobid.

l_wa_temp_new-orgid = l_wa_temp_job_org-orgid.

l_wa_temp_new-orgabv = l_wa_temp_job_org-orgabv. (orgabv is short text

for orgdesc)

l_wa_temp_pos_new-Actualt = v_index. -


i want to give count

append l_wa_temp_new to l_i_temp_final.

ENDON.

endloop.

The l_i_temp_final is my final internal table which iam going to display on the screen

which has the fields a) jobNo b) orgid c) orgabv d) Acutal

The Actual is not thing but the count whether the orgabv is 1 or 2 or 3 ....on the screen.

however i will not display orgid as iam displaying orgabv(orgdesc).

so could you please let me know how can i achieve increment in the count field (Actual)

and display on the screen.

Kinda Regards

latha.

Tags:
Former Member
Former Member replied

Try using this !

data:
w_index type i.

loop at fp_i_temp_job_org into l_wa_temp_job_org.
wa_temp_job_org_2 = l_wa_temp_job_org.
add 1 to w_index.
Delete
AT NEW fp_i_temp_job_org-orgabv .
l_wa_temp_new-jobid = wa_temp_job_org_2-jobid.
l_wa_temp_new-orgid = wa_temp_job_org_2-orgid. 
l_wa_temp_new-orgabv = wa_temp_job_org_2-orgabv. (orgabv is short text 
for orgdesc)
l_wa_temp_new-Actualt = w_index. ------------i want to give count 
append l_wa_temp_new to l_i_temp_final.
w_index = 0.
ENDAT.
endloop. 

I guess this will work

Regards

Nishant

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question