2007 Aug 13 7:19 PM
Hi gurus,
I have to couple of validations in FI...Would appreciate if someone can help me with the code:
1.
Description: Product is Valid
Pre-requisites: BSEG-ZZPRO < >
Pseudo code: Store Posting Date BKPF-BUDAT to i_END_DT and BSEG-ZZPRO to i_ZZPRO and check that in Z-table ZTFICO_ZZPRO_V
ZTFICO_ZZPRO_V END_DT > than i_END_DT where ZZPRO = i_ZZPRO
If not (Product not found or END_DT < BKPF-BUDAT) issue an error message Product &Product& is not valid
2.
Description: Product allowed for Profit Center entered
Pre-requisites: BSEG-BUKRS LIKE '2*' AND BSEG-ZZPRO <> ' '
Pseudo code: Store BSEG-ZZPRO to i_ZZPRO and BSEG-PRCTR to i_PRCTR and check in Z-Table ZTFICO_PROD_PRCTR_V
Select * from ZTFICO_PROD_PRCTR_V where ZTFICO_PROD_PRCTR_V-PRCTR = i_PRCTR AND ZTFICO_PROD_PRCTR_V-ZZPRO = i_ZZPRO.
If not found issue error message Product &i_ZZPRO& not valid for Profit Center &i_PRCTR&
Can someone plz suggest something...
Thanks
Cheers:
Sam
Note: More validations are there but i am right now doing these two..
Please help...
Message was edited by:
Sam williams
2007 Aug 13 7:35 PM
data : i_end_dt like vbkp-budat.
data : x_ztfico_zzpro_v like ztfico_zzpro_v .
data : i_zzpro like besg-zzpro.
data : message(40) type c.
Select single budat from bkpf into i_end_dt.
select single zzpro from bseg into i_zzpro where zzpro <> ' '.
select single * from ztfico_zzpro_v into x_ztfico_zzpro_v where end_dt > i_end_dt and zzpro eq i_zzpro.
if sy-subrc ne 0.
concatenate 'Product' 'Your Product Variable' 'is not valid' into message.
message e000(GIve ur Message class) with message.
endif.
2)
select single zzpro from bseg into i_zzpro where bukrs like '2%' and zzpro <> ' '.
if sy-subrc eq 0.
Select * from ZTFICO_PROD_PRCTR_V where PRCTR = i_PRCTR AND ZZPRO = i_ZZPRO.
if sy-subrc ne 0.
clear messages.
concatenate 'roduct' &i_ZZPRO& 'not valid for Profit Center' &i_PRCTR&
into messages.
message e000(Mclass) with messages.
endif.
endif.
Hi gurus,
I have to couple of validations in FI...Would appreciate if someone can help me with the code:
1.
Description: Product is Valid
Pre-requisites: BSEG-ZZPRO < >
Pseudo code: Store Posting Date BKPF-BUDAT to i_END_DT and BSEG-ZZPRO to i_ZZPRO and check that in Z-table ZTFICO_ZZPRO_V
ZTFICO_ZZPRO_V END_DT > than i_END_DT where ZZPRO = i_ZZPRO
If not (Product not found or END_DT < BKPF-BUDAT) issue an error message Product &Product& is not valid
2.
Description: Product allowed for Profit Center entered
Pre-requisites: BSEG-BUKRS LIKE '2*' AND BSEG-ZZPRO <> ' '
Pseudo code: Store BSEG-ZZPRO to i_ZZPRO and BSEG-PRCTR to i_PRCTR and check in Z-Table ZTFICO_PROD_PRCTR_V
Select * from ZTFICO_PROD_PRCTR_V where ZTFICO_PROD_PRCTR_V-PRCTR = i_PRCTR AND ZTFICO_PROD_PRCTR_V-ZZPRO = i_ZZPRO.
If not found issue error message Product &i_ZZPRO& not valid for Profit Center &i_PRCTR&
Can someone plz suggest something...
Thanks
Cheers:
Sam
Note: More validations are there but i am right now doing these two..
Please help...
Message was edited by:
Sam williams
2007 Aug 13 7:35 PM
data : i_end_dt like vbkp-budat.
data : x_ztfico_zzpro_v like ztfico_zzpro_v .
data : i_zzpro like besg-zzpro.
data : message(40) type c.
Select single budat from bkpf into i_end_dt.
select single zzpro from bseg into i_zzpro where zzpro <> ' '.
select single * from ztfico_zzpro_v into x_ztfico_zzpro_v where end_dt > i_end_dt and zzpro eq i_zzpro.
if sy-subrc ne 0.
concatenate 'Product' 'Your Product Variable' 'is not valid' into message.
message e000(GIve ur Message class) with message.
endif.
2)
select single zzpro from bseg into i_zzpro where bukrs like '2%' and zzpro <> ' '.
if sy-subrc eq 0.
Select * from ZTFICO_PROD_PRCTR_V where PRCTR = i_PRCTR AND ZZPRO = i_ZZPRO.
if sy-subrc ne 0.
clear messages.
concatenate 'roduct' &i_ZZPRO& 'not valid for Profit Center' &i_PRCTR&
into messages.
message e000(Mclass) with messages.
endif.
endif.
2007 Aug 13 7:47 PM
Thanks for the reply...
If i have to do these validations as a function module what will be the importing parameters and how can i do it...it might be that my manager wants to so this as a FM...
Please suggest...thanks...
2007 Aug 13 7:54 PM
HI,
Just pass the product number as input and do you want to return the message from the function module as export parameter.
Thanks
Mahesh
2007 Aug 13 8:15 PM
I think so we have to return the message from the Function module...
How can i do that...
Also, I have more validations to do...i willl just post in some time...
Thanks for ur help mahesh...Appreciated...
I am awarding u full points for this....
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |