07-14-2010 10:47 AM
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
07-14-2010 12:35 PM
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.
07-14-2010 12:35 PM
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.
07-14-2010 12:46 PM
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