Application Development 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: 

Need Help in process data

Former Member
0 Kudos

Hi All,

Pls help me how to achieve this.

select single VKORG and AUART from YINCOSHIP where VKORG = VBAK-VKORG and AUART = VBAK-AUART.
if sy-subrc = 0:
skip the new changes
else.
select single VKORG from YINCOSHIP where VKORG = VBAK-VKORG and AUART = ""
if sy-subrc = 0.
do the changes
else.
skip the changes

After sy-subrc = 0, if I write EXIT does it work? I saw in documentation of EXIT, was given preferable to use in LOOP.

Im writing this code in subroutine, If i write EXIt and it satisfies it comes out of FORM.But there is code after the above code.

but in first condition, if sy-subrc = 0, I want to skip the changes.Need to skip from only IF condition.

Pls let me know hw to do it?

Rgs,

Priya

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Really a very basic question, I think, but consider this:

select single VKORG AUART from YINCOSHIP  into (wa_vkorg, wa_auart)  
    where VKORG eq VBAK-VKORG
        and AUART eq VBAK-AUART.  " YINCOSHP is keyed only by sales org and doc type?
if sy-subrc NE 0.
select VKORG from YINCOSHIP into wa_vkorg up to 1 rows
     where VKORG eq VBAK-VKORG and AUART eq space.
  if sy-subrc eq 0.
do the changes
endif.
endif.

Is this what you're trying to do? Essentially if vkorg and auart exist, ignore the update. If auart does not exist, try to read by vkorg only. If sales org is found, perform updates.

2 REPLIES 2

Former Member
0 Kudos

Really a very basic question, I think, but consider this:

select single VKORG AUART from YINCOSHIP  into (wa_vkorg, wa_auart)  
    where VKORG eq VBAK-VKORG
        and AUART eq VBAK-AUART.  " YINCOSHP is keyed only by sales org and doc type?
if sy-subrc NE 0.
select VKORG from YINCOSHIP into wa_vkorg up to 1 rows
     where VKORG eq VBAK-VKORG and AUART eq space.
  if sy-subrc eq 0.
do the changes
endif.
endif.

Is this what you're trying to do? Essentially if vkorg and auart exist, ignore the update. If auart does not exist, try to read by vkorg only. If sales org is found, perform updates.

0 Kudos

Hi,

Yes, have done it the same way u suggested.

I know it was a very basic question, but got confused in between, Im the only abaper in my team, So thought take the help of people like u.

Thanks,

Priya