How to do validations in FI..?

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

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.

Similar Messages

  • How to change validity period of cost centre or activity type

    Hi
    How to change validity period for an Activity type or Cost centre?
    Can we change the validity period once created?
    regards
    Prakash

    Please note this can be done.
    Go to Edit Cost Center
    Goto Edit, Analysis Period.
    Create a new validity period say today until 3112999
    Change the data you want and save.
    When you go into the CC again it will show two validity periods.

  • How to do validation in RFC

    hi all
                 how to do validation in file to RFC
    regards
    krish

    Hi krish,
    Yes you can validate with RFC,please see below links
    http://help.sap.com/saphelp_nw04/helpdata/en/76/98384162316532e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/11/028417f9f8b24cbe1b0b398e1cb76a/frameset.htm
    CO Validation using RFC - URGENT!!!
    User RFC validation
    RFC Sequence
    Regards
    Chilla..

  • How to do  validation in jsp using javascript

    how to do validation in jsp using javascript

    The same way you do with any HTML page.
    Catch the onclick/onsubmit event, do your validation in javascript and then allow/cancel the action as required.
    However this is javascript validation only - javascript can never call JSP code.

  • How to select valid lines in a secondary list in a interactive report

    hi
    how to select valid lines in a secondary list in a interactive report

    hi,
    do this one
    at line-selection.
    if sy-lsind = some list no.
    GET CURSOR FIELD FIELDNAME VALUE FIELDVALUE.
            IF FIELDNAME = 'TVBAK-VBELN'.
    do some thing
    Regards
    ASHOK KUMAR

  • How to do validation

    can any one help me that how to do validation. if there is any document for that pls send me to [email protected]
    thanks in advance

    Hi Vishwanath,
    Pls do check the link below
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8c92d590-0201-0010-5aa0-ee7a993f295c
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/968dab90-0201-0010-c093-9d2a326969f1
    ****Assign Points If Helpful****
    Regards,
    Ravikanth

  • How to do validations for select-options

    Hi gurus,
    can you suggest me
    how to do validations for select-options
    Thanks&ragards,
    Kals.

    HI,
    TABLES: BKPF.
    TYPES: BEGIN OF TY_BKPF,
           BUKRS TYPE BUKRS,   "COMPANY CODE
           GJAHR TYPE GJAHR,   "FISCAL YEAR
           MONAT TYPE MONAT,   "FISCAL PERIOD
    DATA: T_BKPF TYPE TABLE OF TY_BKPF,
          W_BKPF TYPE TY_BKPF.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_CODE   FOR BKPF-BUKRS,
                    S_YEAR   FOR BKPF-GJAHR,
                    S_PERIOD FOR BKPF-MONAT.
    SELECTION-SCREEN: END OF BLOCK B1.
                        AT SELECTION-SCREEN                           *
    IF S_CODE IS INITIAL OR S_YEAR IS INITIAL OR S_PERIOD IS INITIAL.
      MESSAGE E000(0) WITH 'ENTER VLAUES'.
    ENDIF.
    SELECT SINGLE * FROM BKPF WHERE BUKRS IN S_CODE.
      IF SY-SUBRC <> 0.
      MESSAGE E000(0) WITH 'ENTER VALID VALUES'.
      ENDIF.
    reward if useful
    thanks and regards

  • How to skip validations in ADF on click of cancel button

    Hi,
    I am new to this technology. i Have used ADF components required property to do Required filed validations. Whne i click on Cancel button i dont want the validations to get executed. How to skip validations in ths case?
    I am using ADF 11g and JSF 2.2

    Set immediate property of the cancel button to true.
    Check this out.
    http://jobinesh.blogspot.com/2009/08/how-to-skip-validation.html
    -Arun

  • How to apply validation rule for View Object (VO) attributes?

    How to add Validation Rules to VO attributes, just like EO Business Rules?
    I got 2 problem with that:
    1. VO can join multiple tables, and the attribute's validation rules may reference to the fields from multiple entities.
    2. Since the EO Validation Rules only execute before the data actually write to entity (Commit operation). But user may need to input data from multiple pages with only 1 commit.
    I am using JDeveloper 11g with ADF BC.
    Regards,
    Samson Fu

    Just something to point out, the EO validation doesn't fire on a commit (if you mean commit as in the database/AppModule commit). You can also access VO information from the EO validation rules by using view accessors.
    Regards
    Grant

  • How to create validation in workflow

    I create a simple workflow application, but how to do validation in this application? thanks in advance

    HI SharpLj,
    Activity validation enables activity authors and users to identify and report errors in an activity’s configuration prior to its execution. Windows Workflow Foundation (WF) provides the following three types of activity validation:
    RequiredArgument and OverloadGroup attributes.
    Imperative code-based validation.
    Declarative constraints.
    Further information:
    Configuring Activity Validation
    Please let me know if there is anything that I can do to help.
    Best regards,
    Angie
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to write validation

    Hi all,
    As per my client requirement I have to write one validation like if postings should not happen more than the 2 days ago of current date.
    Eg if Posting date is 20.05.2011
    system should not allow postings less than 2 days of 20.05.2011 means which allow upto 19.05.2011 and 18.05.2011.
    please give any suggestions how to write validation for it
    Thanks
    Prashant Atri

    Hi All,
    Please tell me how to solve my query.
    In Cash Journal
    If the posting date is 20.05.2011 and system should not allow postings before 17.05.2011.  which means posting should happen (current posting date and posting date 20.05.2011 minus 2days earlier the posting date) only.
    Present validations are BKPF-BUDAT = BKPF-CPUDT for this I want to add 2 more days.
    Please guide how to do validation in this case.
    Regards,
    Prashant.

  • How to change validity in info record

    dear experts ,
    how to change validity in info record
    Srithar K

    HI,
    Tocode - ME12
    Enter Vendor code and Material and press enter button.
    After you can change the Validy on Date.
    Regards,
    PK.

  • Trying to rent movie from Apple TV. Message states a valid address is necessary to purchase. We have purchased about 15 show in the last month along. Any suggestion on how to update valid email address

    trying to rent movie from Apple TV. Message states a valid address is necessary to purchase. We have purchased about 15 show in the last month along. Any suggestion on how to update valid email address.

    I got the same error and can't get it to work.  My email and home address have not changed in the 3 years I've been using this device, my credit card info is up to date and my most recent rental was 2 days ago yet I get the error message on both the Apple TV and in iTunes.  I don't understand what the issue is, nothing is invalid.

  • How to change validity from.. to dates in cost centre(production) ?

    Dear All,
    We have created cost centre(production) on current dates ? Due to this,
    We were unable to maintain activity price for work centre.
    Message is telling us to maintain activity price for current fiscal year.
    How to change validity from date in production cost centre(KS02) ?
    Appreciate valuable inputs.
    Jeyakanthan

    Dear ,
    1.Go to Transaction Code KS02 - change cost center and in the next screen go to Menu bar > Edit > Analysis Period.This will pop up another window - in this you can change the analyis period and save it.
    2.Or Use the tcode OKEON from the hierrachy choose the cost center in the basic data tab u will see one button named Validity period.Change the validity there.
    3.You can do it using 'KSH2' transaction.Open the hirarchy and select your cost center. now select the business area and new hirarchy node where you want to move it. and click on 'INSERT AT LOWER LEVEL' to move the cost center from one business area to another.
    Try and check
    regards
    JH

  • How to write Validations for Sample Data??

    Hi Frnds,
    I want to know how to write validations  for sample oracle data?? Can anyone explain anyone clearly??
    Regards,
    Raj

    Hi shushma,
    Simply put a check that:
    If(wdContext.current<YOUR_NODE>Element().get<YOUR_ATTRIBUTE_NAME> !=null){
    else{
    // Show the error messages
    //Displaying the error message is very easy.
    //You can report exception using the message manager API's. You will get this easily on SDN.
    I hope this helps! if you need ay further help please let me know.
    Thanks and Regards,
    Pravesh

  • How to write Validations for RadioButton

    Hi All,
    in my Application , two RadioButtons and one submitbutton is there, in that
    1. yes
    2. no
    both are radio buttons
    when i click on submit button, without selecting any one of those radiobuttons ,
    it shud display error message, this errormessage i have written in iwdmessage.
    it shud show this error message, instead of displaying nullpointer exception.
    how to write validation for this.
    please help me.
    regards
    sush

    Hi shushma,
    Simply put a check that:
    If(wdContext.current<YOUR_NODE>Element().get<YOUR_ATTRIBUTE_NAME> !=null){
    else{
    // Show the error messages
    //Displaying the error message is very easy.
    //You can report exception using the message manager API's. You will get this easily on SDN.
    I hope this helps! if you need ay further help please let me know.
    Thanks and Regards,
    Pravesh

Maybe you are looking for

  • Can't get embedding characters to work

    Hi I have to embed VAGRounded bold. I can't seem to get it to work reliably. I have created 4 dynamic text boxes, one for each of the 4 styles and embedded the characters into each one for the 4 versions of the font. I then wrote some text directly i

  • Some basic doubts

    hi, is there any measurement for table redefinition like index rebuild. For index rebuid we are using indexstat. how to find whether the archived log is necessary or not. what is the difference between execution and fetch? what the relation between I

  • Flex Builder 3 on Max OS X 10.4.11?

    Hi, Does anyone know why it is not possible to run Flex Builder 3 on Mac OS X 10.4.11 on PPC? I tried installing the builder, and everything seemed to go fine, except for one error near the end: quote: Execute Target File: aum.fb.module.app Status: E

  • Burning CD's that won't open on my PC

    I am making CD's to send images to galleries and parts of them will not open on my old PC. Parts of them open, but the pdf files won't open. The parts that open are very clumsy, and I need to open each image individually, so the contact page is impor

  • How to invert plotting direction

    Hey everyone, I am performing the raster scan and plotting the image with 2D Intensity graph. It would be nice to change the plotting origin and direction (to make the image match to physical reality). What do I mean: Is it possible to make upper rig