cancel
Showing results for 
Search instead for 
Did you mean: 

Modify the Table Data only for Fiscper restrictions

Former Member
0 Kudos

Hello friends. Thanks to SDN for getting the below code work. I just need to fix this last one. I want to modify only the data for Fiscper 001.2007 and 002.2007. I was able to modify all the data in Table /BIC/AZDAFIGL000 but when I put the restriction Fiscper 001.2007 it does not modify the data Table /BIC/AZDAFIGL000

Message was edited by:

soniya kapoor

Accepted Solutions (1)

Accepted Solutions (1)

former_member195698
Active Contributor
0 Kudos

Your condition should be

AND (FISCPER = '001.2007' OR FISCPER = '002.2007').

If you put AND (FISCPER = '001.2007') AND ( FISCPER = '002.2007'). The condition will always fail.

TRUE AND FALSE = FALSE.

TRUE AND TRUE = TRUE.

Since the Value of FISCPER can never be 001.2007 and 002.2007 at the same time, the condition fails

Regards,

Abhishek

Message was edited by:

Abhishek Jolly

Former Member
0 Kudos

Hello friend , I did this as per your suggestion on Fiscper statement but still it does not pull and modify the records for Fiscper 001.2007 and 002.2007

Message was edited by:

soniya kapoor

naimesh_patel
Active Contributor
0 Kudos

Can you give the strcuture information for the FISCPER?

Like .. reference domain, data type, length... ??

Regards,

Naimesh Patel

former_member195698
Active Contributor
0 Kudos

Hi Soniya.

Your code is not correct.

LOOP AT I_MAT into wa_itab.

select * from /BIC/AZDAFIGL000 into wa_zdtg

WHERE COMP_CODE EQ wa_itab-COMP_CODE AND PROFIT_CTR EQ

WA_ITAB-PROFIT_CTR AND ( FISCPER = '001.2007' OR FISCPER = '002.2007')

IF SY-SUBRC = 0.

wa_zdtg-/BIC/ZCONSUNIT = wa_itab-/BIC/ZCONSUNIT.

ENDIF.

MODIFY /BIC/AZDAFIGL000 from wa_zdtg.

endselect.

endloop.

Your modify statement was outside the loop. So the data was not getting updated in the database table.

Former Member
0 Kudos

I did this but it is not working. what I need to do FISCPER Is standard content

LOOP AT I_MAT into wa_itab.

select * from /BIC/AZDAFIGL000 into wa_zdtg

WHERE COMP_CODE EQ wa_itab-COMP_CODE AND PROFIT_CTR EQ

WA_ITAB-PROFIT_CTR AND ( FISCPER = '001.2007' OR FISCPER = '002.2007')

IF SY-SUBRC = 0.

wa_zdtg-/BIC/ZCONSUNIT = wa_itab-/BIC/ZCONSUNIT.

ENDIF.

MODIFY /BIC/AZDAFIGL000 from wa_zdtg.

endselect.

endloop.

former_member195698
Active Contributor
0 Kudos

Is the select query failing or the modification ?

naimesh_patel
Active Contributor
0 Kudos

Can try with this:

LOOP AT I_MAT into wa_itab.

select * from /BIC/AZDAFIGL000 into wa_zdtg
WHERE COMP_CODE EQ wa_itab-COMP_CODE AND PROFIT_CTR EQ
WA_ITAB-PROFIT_CTR AND ( FISCPER = <b>'2007001'</b> OR FISCPER = <b>'2007002'</b>)  " <<<


IF SY-SUBRC = 0.

wa_zdtg-/BIC/ZCONSUNIT = wa_itab-/BIC/ZCONSUNIT.

ENDIF.
MODIFY /BIC/AZDAFIGL000 from wa_zdtg.

endselect.

endloop.

Regards,

Naimesh Patel

Former Member
0 Kudos

Hello friends, Select query is failing, modification work fine if I remove fiscper restriction.

I use nimesh template it says <b> b not declared nor as Data .

I removed <b> b and its working. but now i will just post another where i will use the logic to use the select statement based on current quater based on system date.

thanks alot for all friends help

thanks

soniya

null

soniya kapoor

Answers (0)