How do i get my code to be applicable in a certain case only

Greetings ABAPers. I would like to know the various ways in which i can get my code to be applicable in a certain case. Ive include the code below. I want the code to execute only when the object type is 'BP' for business partner. That is, i want my logic (code) to execute only when the object type is an external object (BP) otherwise it should be handled normally the way SAP handles internal objects. The tricky part for me isnt the actual check because i could have used the CHECK statement. The tricky part is how do i tell it to handle it the way SAP handles normal internal object assignments.
Any suggestions as to how i can clean up my code and improve my commenting is also greatly appreciated.
Code:
method if_ex_hrbas00infty~before_output.
Ensure that this validation only occurs for this user
  check sy-uname = 'LMANDIMIKA'.
If the function code is an insert then continue or stop otherwise
  check pppar-fcode = 'INSE'.
*Data declarations
  data: lt_hrp1001 type table of hrp1001,
        ls_hrp1001 type hrp1001,
        lv_sobid type sobid,
        lv_sclas type sclas,
        lv_rsign type rsign,
        lv_relat type relat,
        lv_plvar type plvar,
        lv_otype type objid.
Clear the local table and local variables
  refresh lt_hrp1001.
  clear: lv_sobid, lv_sclas, lv_rsign, lv_relat, ls_hrp1001, lv_plvar, lv_otype.
*Take our data declarations and insert data elements from the new relationship which we are trying to create.
  lv_sclas = old_innnn-vdata+0(2).    "target object type
  lv_sobid = old_innnn-vdata+2(10).   "target object ID
  lv_rsign = old_innnn-subty+0(1).    "relationship direction
  lv_relat = old_innnn-subty+1(3).    "relationship type
  lv_otype = old_innnn-otype.
  lv_plvar = old_innnn-plvar.         "planned version
*Check for existing relationships between a BP of that type with other external objects
  select * from hrp1001 into table lt_hrp1001
    where plvar = old_innnn-plvar
      and sobid = lv_sobid
      and sclas = lv_sclas
      and rsign = lv_rsign
      and relat = lv_relat
      and otype = lv_otype.
*Loop through the table and compare the existing relationship with the new one
  loop at lt_hrp1001
    into ls_hrp1001.
Check that the end date for the existing relationship is after (greater than) the start date for the new relationship.
    if ls_hrp1001-endda > old_innnn-begda and ls_hrp1001-begda < old_innnn-endda.
      message e004(/cco/a3_msg) with lv_relat lv_sobid '' ''.
      exit.
    endif.
  endloop.
endmethod.
Edited by: Lovemore Mandimika on May 14, 2008 10:36 AM

Hello kpmolinarivera,
The iTunes Store country can be changed in Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
iOS: Changing the signed-in iTunes Store Apple ID account
http://support.apple.com/kb/HT1311
Cheers,
Allen

Similar Messages

  • How do i get my code to be applicable in a certain case

    Greetings ABAPers. I would like to know the various ways in which i can get my code to be applicable in a certain case. Ive include the code below. I want the code to execute only when the object type is 'BP' for business partner. That is, i want my logic (code) to execute only when the object type is an external object (BP) otherwise it should be handled normally the way SAP handles internal objects. The tricky part for me isnt the actual check because i could have used the CHECK statement. The tricky part is how do i tell it to handle it the way SAP handles normal internal object assignments i.e. pass execution onto SAP so to speak.
    Any suggestions as to how i can clean up my code and improve my commenting is also greatly appreciated.
    Code:
    method if_ex_hrbas00infty~before_output.
    Ensure that this validation only occurs for this user
    check sy-uname = 'LMANDIMIKA'.
    If the function code is an insert then continue or stop otherwise
    check pppar-fcode = 'INSE'.
    *Data declarations
    data: lt_hrp1001 type table of hrp1001,
    ls_hrp1001 type hrp1001,
    lv_sobid type sobid,
    lv_sclas type sclas,
    lv_rsign type rsign,
    lv_relat type relat,
    lv_plvar type plvar,
    lv_otype type objid.
    Clear the local table and local variables
    refresh lt_hrp1001.
    clear: lv_sobid, lv_sclas, lv_rsign, lv_relat, ls_hrp1001, lv_plvar, lv_otype.
    *Take our data declarations and insert data elements from the new relationship which we are trying to create.
    lv_sclas = old_innnn-vdata+0(2). "target object type
    lv_sobid = old_innnn-vdata+2(10). "target object ID
    lv_rsign = old_innnn-subty+0(1). "relationship direction
    lv_relat = old_innnn-subty+1(3). "relationship type
    lv_otype = old_innnn-otype.
    lv_plvar = old_innnn-plvar. "planned version
    *Check for existing relationships between a BP of that type with other external objects
    select * from hrp1001 into table lt_hrp1001
    where plvar = old_innnn-plvar
    and sobid = lv_sobid
    and sclas = lv_sclas
    and rsign = lv_rsign
    and relat = lv_relat
    and otype = lv_otype.
    *Loop through the table and compare the existing relationship with the new one
    loop at lt_hrp1001
    into ls_hrp1001.
    Check that the end date for the existing relationship is after (greater than) the start date for the new relationship.
    if ls_hrp1001-endda > old_innnn-begda and ls_hrp1001-begda < old_innnn-endda.
    message e004(/cco/a3_msg) with lv_relat lv_sobid '' ''.
    exit.
    endif.
    endloop.
    endmethod.

    Hello kpmolinarivera,
    The iTunes Store country can be changed in Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
    iOS: Changing the signed-in iTunes Store Apple ID account
    http://support.apple.com/kb/HT1311
    Cheers,
    Allen

  • How do I get my code changes to show when published in Business Catalyst?

    I have created my website using !Adobe Muse and have used the Ecwid ecomm widget to integrate a shop. As I wasn't happy with the font, colour, etc, I changed the code using the edit 'html' function, accessing the code information from a design browser mode and then further on in the process, I published it to Business Catalyst. However, now the changes don't show. How do I get my code changes to show when published in Business Catalyst? Do I need to go through the same process using Business Catalyst?

    Hi,
    Thank you for choosing Ecwid! To change the design of your storefront, you should go to Ecwid Control Panel > Settings > Design > CSS Themes. Find your current active theme and add all the necessary changes in a big input field that you’ll see there. To know more about how to improve your storefront design, please refer to this article http://help.ecwid.com/customer/portal/articles/1083332-how-to-change-ecwid-design
    If you make changes to your CSS Theme but your storefront design remains the same, please refer to this article http://help.ecwid.com/customer/portal/articles/1149625-i-don-t-see-the-changes-i-made-to-m y-css-theme
    Also, you can find a good range of articles and tips on how to improve your Ecwid store in our Help Center http://help.ecwid.com/ Feel free to use it!
    If you get any other questions about CSS or Ecwid functionality, contact us on our forum http://www.ecwid.com/forums/  There we will be able to check your website and provide more specific solutions for you.

  • How can i get the code html and css of my form please help me

    how can i get the code html and css of my form

    HI,
    If you like to embed the HTML form in your web page then you will need to obtain the form code from the Distribite/Embed tab. Additional information can be found here: http://forums.adobe.com/docs/DOC-1991
    You will not be able to access/modify the css code or the rest of the form html code.  If you like to view the source of of a HTML page, please use your browser 'view source code' functionality.
    I hope this answer your question,
    Thanks,
    Lucia

  • How do i redeem a 10.00 gift... when i click redeem i am prompted to download itunes... i already have itunes...how do i get the code... or get past the download

    omg how many times do i have to ask the question...., i am trying to redeem a gift of 10.00.. when i click on redeem it wants me to download itunes... i already have itunes.... how do i get the code.... when it gets this complicated to ask a question it doesnt seem worth it...wass up????

    Redeeming iTunes Gift Cards and content codes
    iTunes 11 for Mac- Redeem an iTunes allowance, gift certificate, or Gift Card
    iTunes 11 for Windows- Redeem an iTunes allowance, gift certificate, or Gift Card
    If you can't redeem your iTunes Gift Card or code

  • What do you do if you purchase Itune cards and the activation code are unreadable. How do I get the codes these are two $50.00 cards.

    I brought two $50 itune cards from best buy yesterday 6/6/2011. When I scratch off the activation code it was unreadable. How do I get my codes. I don't want to lose my $100. Please assist.

    iTunes Store: Invalid, inactive, or illegible codes

  • I scratched the label off on a £25 gift card and it removed the code. How can I get the code for the card?

    I scratched the label off on a £25 gift card and it removed the code. How can I get the code for the card?

    Click here and request assistance. Gift cards are usually if not always final sale because it would be easy enough for someone dishonest to abuse returns or replacements of them.
    (58640)

  • How can i get access code to create ABAP Program ?

    hi guys ,
    How can i get access code for creating ABAP Program in my System.
    I am using SAP IDES 4.6 Version
    Please Help me out .
    Regards
    Raghu

    Hi Raghu,
    - license your system (http://service.sap.com/licensekey)
    - create a developer key (http://service.sap.com/sscr)
    - create a key for your ABAP program (httP://service.sap.com/sscr)
    Markus

  • Am suddenly getting error code 3250 when trying to download certain podcasts...not all, just some. How can I fix? Help.

    Am suddenly getting error code 3250 when trying to download certain podcasts...not all, just some. How can I fix? Help.

    I am getting the same error, and have been, since the last iTunes update.     Driving me crazy, as some podcasts download without issue, others won't download at all, and get the 3250 error code.

  • HT204053 How do I get a code to redeem a gift album sent to me thru the iTunes Store?

    How do you get a code to redeem a gift album sent thru iTunes.  There is nothing indicated on the email that shows a redemption code.

    Did you use a coin to scratch off the numbers like instructed?
    You can contact iTunes Support: http://apple.com/support/itunes/

  • HOW DO I GET THE CODE? (Upgrade från CS 5.5 to 6.0)

    I am trying to install Adobe CS 6 on my computer. The installation goes fine until I enter my serialnumber. Then I get the message "The serial number is valid, but could not find a qualifying product on this computer." When I search on the Adobe site I find information about a new installation process. It says that I no longer need a serialnumber but a code. The question is HOW DO I GET THE CODE?
    The only thing I got on my purchase is our 7 licenses (volume licenses) is 1 order number and 7 serial numbers.

    Adobe what CS6? We are an Audition U2U forum and can't answer any questions about installation issues at all. Adobe have a free assistance chatline available for this - you need to call that.

  • Dear Sirs , my I phone 4 is limited to some network so i wanna make my I phone free to all networkes all over , how can i get the code to unblock it

    Dear Sirs ,
    my I phone 4 is limited to some network so i wanna make my I phone free to all networkes all over , how can i get the code to unblock it

    There is no "code to unblock it". It can only be unlocked by the carrier it's locked to. Contact them and see if they offer that service and if you qualify.

  • How can I get tax code?

    Hi. Experts!
    I'm facing problem how to get tax code!
    Now there is billing document, and condition type for tax is Z100, and it relates to tax code "A1".
    How does SAP decide tax code?
    And how can I get tax code?
    Thanks in advance!

    Hi
    The tax codes are stored in A003.
    Tax code condition records are stored in condition table A003. The plantu2019s country (SD) or the company codeu2019s country (MM) along with the tax code, which was automatically determined from the SD/MM condition records, are used to read the tax condition records stored in table A003.
    [More info|http://help.sap.com/saphelp_rc10/helpdata/en/8c/453438fd263402e10000009b38f8cf/content.htm]
    Shiva

  • TS1292 i scrached my card and three of the numbers or not visible, as in they were scrached out, how do i get my code?

    i bought an itunes card and when i scrached the card 3 digits were missing, how do i get the code back. i still have the card

    Try Here  >  http://support.apple.com/kb/TS1292
    If no joy...
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • How can i know how to redeem the code? how can i get this code?

    how can i know how to redeem the code? how can i get this code? please i need you help
    <Email Edited by Host>

    You are trying to create a new Apple ID? You don't have one yet? Is that correct?
    If so, then see this article on how to creat your Apple ID - and make up a password for it. Remember to write it down immediately.
    http://support.apple.com/en-us/HT203993

Maybe you are looking for

  • Ipad2 issue downloading apps. Help ?

    HI My ability to download apps has stopped. Clicking on the grey FREE box (for example) does not lead to anything - the install or blue progress bar does not appear and nothing happens. There is no storage or capacity issues. This used to be all fine

  • Sending Details -- URGENT HELP REQUIRED! ! !

    Hi, I have a programming problem which I need urgent help with.... 1.) I firstly have a HTML file which a user will fill out 3 fields on and submit. 2.) A servlet will get these parameters, validate some information and update a database. Problem Par

  • How do I get messages sent to my phone number sent to my iPad

    I used to recive iMessages sent to my phone number to my iPad, I got a new phone and I no longer receive them to my iPad. How can I receive iMessages sent to my iPad again.

  • Classic Debugger

    Hi - Every time I run the debugger, I have to click on "Debugger / Classic Debugger" to switch to the classic, which I prefer.  Is that a way for me to have it default to the Classic Debugger so I don't have to do this every time I start up a debugge

  • Flash Builder 4.7 JIRA

    Dear Flash Builder team, first off, who in his right mind decided to create a single JIRA for Flash Builder and Flex? That makes no sense whatsoever! With the retirement of bespoken JIRA in April '13, there will effectively be no bug report system fo