ABAP Coding issue

Hi Abapers,
I am new to ABAP, I am in the process of learning.
I want to do
IF KNVK-PAFKT = Z1
select single smtp_addr FROM adr6 INTO v_smtp_addr
                          WHERE ADDRNUMBER =   v_adrnr.
Endif.
But i am able to get the EMail without IF condition, waht else I need to do if I want to fulfil the IF condition.
Thanks in Advance,
Rishik.

Hi,
Use CLEAR statement before using SELECT
CLEAR v_smtp_addr.
IF KNVK-PAFKT = 'Z1'.
select single smtp_addr FROM adr6 INTO v_smtp_addr
                          WHERE ADDRNUMBER =   v_adrnr.
  IF sy-subrc NE 0. "<--no record found
    CLEAR v_smtp_addr.
  ENDIF.
ENDIF.
Hope this helps you.
Regards,
Tarun

Similar Messages

  • ABAP coding issues after BW upgrade

    Hello Gurus,
    We recently did a BW upgrade from version 3.5 to 7.31 and even since have been encountering few strange issues with many of our ABAP coding.
    For example, there is an APPEND statement in one of our Update Rules as below:
    APPEND <lw_rtab_wa> TO <lt_rtab>.
    Before upgrade, this was working as expected and the contents of <lw_rtab_wa> was getting transferred to <lt_rtab> without any issues.
    Now after upgrade, we find that the contents of <lw_rtab_wa> is being clubbed together in the 1st few columns of <lt_rtab>.
    Both the <lw_rtab_wa> & <lt_rtab> have the same fields, but the length of few fields in <lt_rtab> is bigger than that in <lw_rtab_wa>. For example DOC_NUMBER in <lw_rtab_wa> is of type C(10) while in <lt_rtab> it is C(20). This difference is causing the data of the 2nd field also to be over-writen in the DOC_NUMBER field of <lt_rtab>.
    Please let us know if you have encountered similar situations after your BW upgrade. Any possible solutions to this would be very much appreciated as this is causing PROD issues at the moment!
    Thanks
    Arvind

    Hi Arvind,
    After Upgrade In BW 7.3 or higher versions All data elements that use the domain RSCHAVL are converted from CHAR60 to SSTRING. thats the reason you are getting that syntax error.
    Take help of some ABAP programmer and try to change the syntax as suggested from below link.
    Just scroll down and check the same. even though link shows for BW 7.4 issues, its applicable for 7.3 too. Please let me know
    http://scn.sap.com/community/data-warehousing/bw/blog/2014/07/28/sap-bw-74-analysis-issues
    Thanks
    Ajay

  • ABAP code issue

    Hello Team,
    We are facing ABAP coding performance issue in BW production and quality system. This is holding under production data loading.
    There is piece of code written in BW while loading data from one target to other
    Code:
    DELETE SOURCE_PACKAGE WHERE recordmode = 'X' OR recordmode = 'R'
    OR recordmode = 'D'.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_new_source
    FROM /bic/afao06pa100
    FOR ALL ENTRIES IN SOURCE_PACKAGE
    where /bic/fcckjobno = SOURCE_PACKAGE-/bic/fcckjobno
    and /bic/fcckjitid = SOURCE_PACKAGE-/bic/fcckjitid.
    * Since the preceding tranformation in the data flow already aggregates
    *multiple occurences of single SO into one record the deletion of
    *duplicates
    * is obsolete
    *    SORT SOURCE_PACKAGE BY doc_number ASCENDING s_ord_item ASCENDING
    *    record DESCENDING.
    *    delete ADJACENT DUPLICATES FROM SOURCE_PACKAGE COMPARING doc_number
    *    s_ord_item.
    SORT SOURCE_PACKAGE BY /bic/fcckjobno /bic/fcckjitid.
    LOOP AT it_new_source INTO wa_new_source.
    READ TABLE SOURCE_PACKAGE WITH KEY
    /bic/fcckjobno = wa_source-/bic/fcckjobno
    /bic/fcckjitid = wa_source-/bic/fcckjitid
    BINARY SEARCH
    INTO wa_source.
    IF sy-subrc = 0.
    MOVE-CORRESPONDING wa_new_source TO ls_target_key.
    MOVE-CORRESPONDING wa_source TO wa_new_source.
    MOVE-CORRESPONDING ls_target_key TO wa_new_source.
    MODIFY it_new_source FROM wa_new_source.
    ENDIF.
    ENDLOOP.
    REFRESH SOURCE_PACKAGE.
    SOURCE_PACKAGE[] = it_new_source[].
    REFRESH it_new_source.
    Above code takes long time for execution.
    In production for 3930891 number or records it runs for an hour an hour and goes into infinite loop without loading any data.
    We have tried same data load in quality system. (BR1)
    For 68293 records load has executed for 8-9 hours and then completed successfully.
    I have tried editing code in BR1 system by removing  ‘INTO CORRESPONDING FIELDS OF TABLE’ and written plain selection of all fields. Performed ST05 trace by commenting other code. But still found it is taking time at select statement and not improvement in load run time at start routine.
    Also tried editing select statement like below but it took same time:
    SELECT /BIC/FCCKCANC PCA_DOCTYP PCA_DOCNO PCA_ITEMNO CHRT_ACCTS MATERIAL
    ACCOUNT COMP_CODE CO_AREA PROFIT_CTR VERSION PART_PRCTR FISCPER
    FISCVARNT /BIC/FCCKJITID /BIC/FCCKJOBNO RECORDMODE /BIC/FCCKCNTR
    /BIC/FCCKCNTN /BIC/FCCKEXIMP /BIC/FCCKJOBTP
    /BIC/FCCKINTST /BIC/FCCKMAJBN /BIC/FCCKALST /BIC/FCCHUBIND
    /BIC/FCCSFCLDT /BIC/FCCHDCLDT /BIC/FCCKETADT /BIC/FCCKETDDT
    /BIC/FCCFULFDT /BIC/FCCKHBL /BIC/FCCKCBL /BIC/FCCKJCRBY /BIC/FCCKLCRBY
    INTO TABLE it_new_source
    FROM /bic/afao06pa100
    FOR ALL ENTRIES IN SOURCE_PACKAGE
    where /bic/fcckjobno = SOURCE_PACKAGE-/bic/fcckjobno
    and /bic/fcckjitid = SOURCE_PACKAGE-/bic/fcckjitid.
    Please suggest code improvement.
    Any data base improvement for tables?
    Any indexing improvement for tables?
    If required please get in touch with data base team for same.

    LOOP AT it_new_source INTO wa_new_source.
    do.
    READ TABLE SOURCE_PACKAGE
         INDEX W_TABIX
         INTO wa_source.
    IF SY-SUBRC NE SPACE.
       EXIT.
    ENDIF.
    IF     wa_new_source-/bic/fcckjobno lt wa_source-/bic/fcckjobno.
      exit.
    elseif wa_new_source-/bic/fcckjobno EQ wa_source-/bic/fcckjobno.
      MOVE-CORRESPONDING wa_new_source TO ls_target_key.
      MOVE-CORRESPONDING wa_source TO wa_new_source.
      MOVE-CORRESPONDING ls_target_key TO wa_new_source.
      MODIFY it_new_source FROM wa_new_source.
       EXIT.
    elseif wa_new_source-/bic/fcckjobno gt wa_source-/bic/fcckjobno.
      w_tabix = w_tabix + 1.
    endif.
    ENDIF.
    DONE.
    ENDLOOP.
    I put only for one field control, you must add the second field in the logic.
    With this kind of code you read only 1 time the two tables.
    This code comes from an old age name : R/2  
    regards
    Fred

  • Adobe Bridge CS6, Output to HTML Gallery coding issue.

    Adobe Bridge CS6, Output to HTML Gallery coding issue.
    I have created the html, JavaScript, css file using the output function in Bridge CS6, which nicely generates the coding, pages, folders and files. I can edit the html files such as gallery title, name, etc., in Dreamweaver CS6 just fine and preview them in a selected browser (both chrome and IE) and everything works fine.
    When I ftp upload the files and directories into my hosting account (Go Daddy), the images do not show up. The file table appears but the thumbs images does not appear and when selected to preview the larger image, it does not appear either. I have not altered the file structure at all. Go Daddy says it is a coding issue, but I cannot fine any errors.
    Have you seen this issue before? All Adobe help research have failed. Any suggestions??

    Have you asked on Go Daddy site for help in uploading Adobe Bridge script?  Just to say it is coding is not helpful. 

  • ABAP coding in defining start condition for action.

    Hi Everybody,
    Can anyone tell me if ABAP coding is possible for giving condition for action? If yes, where? Is it in condition editor? I have 3 validations to be done:- 1) Filter service contract (transaction type USC), 2) Filter the active contracts, 3) Filter contracts which doesn't have billing cycle in current month.
    So, do you think these validations can be done in start condition of action? First two validations are static in nature and thus can be done. But, how about the last condition?
    Please help.
    Regards,
    Sanj.

    Hi Sanj
    I would do this.
    1. The transaction type cannot be changed, therfore I will set this up in the scheduling condition.
    2. Active contracts. Depends on teh definiton of active. If it is based on some status then I will use scheduling condition.
    3. use one of the dates in the date profile to determine if the billing date is in the current month or not.
    See if this helps.
    Thanks

  • ABAP coding in LSMW

    Hi All,
    A)Is it possible to  write ABAP coding in LSMW, if yes where can we do this. and
    B)During the First Step of LSMW we come across 1. Standard/Batch Direct Input
                                                                          2.Batch input recording
                                                                          3.Business Object Method (BAPI)
                                                                          4.IDOC(intermediate document)
    which one to use and when to use?
    C) what are the advantages/disadvantages of LSMW compared to other data transfer methods like BDC.
    please let me know the answers for above.
    useful answers will be rewarded for the same.
    Regards,
    Yellappa.

    hi
    for q posed to ashvinder, its used only for validation of the input records and their corresponding processing, i will explain a simple scenario,
    1. if u want to transfer data a part of which has already been created in the system. You
    want to decide at runtime whether the data is created or changed.
    u can write this coding in corresponding field
    2. You want to "skip" a record depending on a certain condition, i.e. this record shall not be converted and transferred to the output file.
    3. Duplicate a Record
    If want complex pricing procedures u cant do that in LSMW, u need to go for BDC's
    for ur question about what to use, BAPI or IDOC, check this link
    http://www.sap-img.com/abap/ale-bapi.htm
    http://searchsap.techtarget.com/generic/0,295582,sid21_gci1089362,00.html?bucket=ETA&topic=299357
    award points if found helpful
    Message was edited by:
            Rahul Kavuri

  • Performance of ABAP coding very poor

    Hi gurus,
    I'm a newbie in ABAP programming.
    Currently, I managed to write an ABAP coding for BW to load data from a source DSO to target DSO.
    We are using BW 3.5.
    In the source, we have YTD amount as Key Figures.
    In the start routine, we use ABAP coding to calculate the Monthly value and Last 12 Months value.
    Monthly value is defined as: current month YTD - last month YTD (except when current month = January, then monthly value for January = YTD value for January)
    Last 12 months value is calculated for example as follow:
    for March 08, then Last 12 months value is April 07-March08
    Thus the formula for last 12 Months value is:
               YTD current month current year + YTD month12 last year - YTD current month last year
    I used internal table to read and store all of the information
    However, I need to read 3 times from internal table to get all of the necessary value to calculate the monthly value and last 12 months value.
    The performance is very low. The system runs for 40 minutes to read and calculate 15500 data.
    Therefore if you can perhaps give some hint/tip/tricks how to improve the performance of the code, it will be highly appreciated.
    Thank you very much in advance.
    Best regards,
    Fen
    My code is as follow:
    Define internal table to hold last year & current year data:
      DATA: LCYEARDATA type sorted table of /bic/aZABC3_O00
            with unique key /BIC/ZABC_ENTI /BIC/ZABC_ACC
            /BIC/ZABC_SUBA /BIC/ZABC_VERS CALMONTH
            with header line.
    Create variables needed to hold last month/year values.
      DATA: CALMONTHLOW TYPE /BI0/OICALMONTH.
      DATA: CALMONTHHIGH TYPE /BI0/OICALMONTH.
      DATA: CALYEARTHISYEAR TYPE /BI0/OICALYEAR.
      DATA: CALYEARLASTYEAR TYPE /BI0/OICALYEAR.
      DATA: CURRENTMONTH TYPE /BI0/OICALMONTH2.
      DATA: CURRENTMONTHLASTYEAR TYPE /BI0/OICALMONTH.
      DATA: LASTMONTH TYPE /BI0/OICALMONTH.
      DATA: CALMONTH12LASTYEAR TYPE /BI0/OICALMONTH.
      DATA: LASTMOYTD type /BI0/OIAMOUNT.
      DATA: LAST12MONTH TYPE /BI0/OIAMOUNT.
      DATA: YTDLASTYEAR type /BI0/OIAMOUNT.
      DATA: FIRSTRUN type N.
      DATA: MONTHLYVALUE type /BI0/OIAMOUNT.
      DATA: YTDMONTHLASTYEAR type /BI0/OIAMOUNT.
      DATA: AMOUNT type /BI0/OIAMOUNT.
    Set initial value of all variables to 0.
      CALMONTHLOW = 0.
      CALMONTHHIGH = 0.
      CALYEARTHISYEAR = 0.
      CALYEARLASTYEAR = 0.
      CURRENTMONTH = 0.
      CURRENTMONTHLASTYEAR = 0.
      LASTMONTH = 0.
      LASTMOYTD = 0.
      LAST12MONTH = 0.
      YTDLASTYEAR = 0.
      YTDMONTHLASTYEAR = 0.
      FIRSTRUN = 0.
      MONTHLYVALUE = 0.
      CALMONTH12LASTYEAR = 0.
    Loop through data package.
      LOOP AT DATA_PACKAGE.
        IF DATA_PACKAGE IS NOT INITIAL.
    First run:
          IF FIRSTRUN = 0.
    Get current year from any line in the data package.
            CALYEARTHISYEAR = DATA_PACKAGE-CALMONTH(4).
            FIRSTRUN = 1.
          ENDIF.
    Calculate last year (i.e. data package year - 1).
            CALYEARLASTYEAR = CALYEARTHISYEAR - 1.
    Calculate current month
            CURRENTMONTH = DATA_PACKAGE-CALMONTH+4(2).
    *Set CALMONTHLOW and CALMONTHHIGH as time period to fill the internal
    *table:
            CONCATENATE CALYEARLASTYEAR CURRENTMONTH INTO CALMONTHLOW.
            CONCATENATE CALYEARTHISYEAR CURRENTMONTH INTO CALMONTHHIGH.
    Fill internal table with Last Years data and Current Year data:
            select *
              from /bic/aABC2_O00
              into table LCYEARDATA
              WHERE CALMONTH >= CALMONTHLOW
                AND CALMONTH <= CALMONTHHIGH
                AND /BIC/ZABC_ENTI = DATA_PACKAGE-/BIC/ZABC_ENTI
                AND /BIC/ZABC_ACC = DATA_PACKAGE-/BIC/ZABC_ACC
                AND /BIC/ZABC_SUBA = DATA_PACKAGE-/BIC/ZABC_SUBA
                AND /BIC/ZABC_VERS = DATA_PACKAGE-/BIC/ZABC_VERS.
    Continue with the looping
    Get last month from current month.
            LASTMONTH = DATA_PACKAGE-CALMONTH - 1.
    *CHECK IF CURRENTMONTH = JAN then LastmonthYTD amount = 0, else read
    *from the internal table.
    *CURRENTMONTH = DATA_PACKAGE-CALMONTH+4(2). (this variable has been set
    *above)
            IF CURRENTMONTH = '01'.
              LASTMOYTD = 0.
            ELSE.
              READ TABLE LCYEARDATA
                WITH KEY
                /BIC/ZABC_ENTI = DATA_PACKAGE-/BIC/ZABC_ENTI
                /BIC/ZABC_ACC = DATA_PACKAGE-/BIC/ZABC_ACC
                /BIC/ZABC_SUBA = DATA_PACKAGE-/BIC/ZABC_SUBA
                /BIC/ZABC_VERS = DATA_PACKAGE-/BIC/ZABC_VERS
                  CALMONTH = LASTMONTH.
              IF sy-subrc IS INITIAL.
                LASTMOYTD = LCYEARDATA-AMOUNT.
              ENDIF.
            ENDIF.
    *Calculate Monhtly value for this month (to later be stored in data
    *package)
            MONTHLYVALUE = DATA_PACKAGE-AMOUNT - LASTMOYTD.
    Count value for Last 12 Months:
    1: Get the YTD Month12 Last Year & YTD CurrentMonth Last Year.
            CONCATENATE CALYEARLASTYEAR CURRENTMONTH INTO
            CURRENTMONTHLASTYEAR.
            CONCATENATE CALYEARLASTYEAR '12' INTO CALMONTH12LASTYEAR.
            READ TABLE LCYEARDATA
               WITH KEY
                /BIC/ZABC_ENTI = DATA_PACKAGE-/BIC/ZABC_ENTI
                /BIC/ZABC_ACC = DATA_PACKAGE-/BIC/ZABC_ACC
                /BIC/ZABC_SUBA = DATA_PACKAGE-/BIC/ZABC_SUBA
                /BIC/ZABC_VERS = DATA_PACKAGE-/BIC/ZABC_VERS
                 CALMONTH = CALMONTH12LASTYEAR.
            IF sy-subrc IS INITIAL.
              YTDLASTYEAR  = LCYEARDATA-AMOUNT.
            ENDIF.
            READ TABLE LCYEARDATA
              WITH KEY
                /BIC/ZABC_ENTI = DATA_PACKAGE-/BIC/ZABC_ENTI
                /BIC/ZABC_ACC = DATA_PACKAGE-/BIC/ZABC_ACC
                /BIC/ZABC_SUBA = DATA_PACKAGE-/BIC/ZABC_SUBA
                /BIC/ZABC_VERS = DATA_PACKAGE-/BIC/ZABC_VERS
                CALMONTH = CURRENTMONTHLASTYEAR.
            IF sy-subrc IS INITIAL.
              YTDMONTHLASTYEAR  = LCYEARDATA-AMOUNT.
            ENDIF.
    2. Specify YTD This month.
        AMOUNT = DATA_PACKAGE-AMOUNT.
    *3: Last 12 Months = (YTD Last Year - YTD Month Last Year) + YTD This
    *Month
           LAST12MONTH = YTDLASTYEAR - YTDMONTHLASTYEAR + YTDTHISMONTH.
           LAST12MONTH = YTDLASTYEAR - YTDMONTHLASTYEAR + AMOUNT.
    Save MONTHLYVALUE and LAST12MONTH to the DATA_PACKAGE.
            DATA_PACKAGE-/BIC/ZAMTMO = MONTHLYVALUE.
            DATA_PACKAGE-/BIC/ZAMTLTM = LAST12MONTH.
            modify DATA_PACKAGE.
            ENDIF.
          ENDLOOP.
        ABORT = 0.

    Hi,
    Just check these blogs to improve performance...
    The SQL Trace (ST05) u2013 Quick and Easy
    The SQL Trace (ST05) – Quick and Easy
    The ABAP Runtime Trace (SE30) - Quick and Easy
    The ABAP Runtime Trace (SE30) -  Quick and Easy
    Regards,
    Sachin

  • Docs for ABAP coding for BW

    Hello Gurus,
    I need some documents or links where i can find enough info to learn abt ABAP coding in transfer, update rules, ABAP routine in infopackage and in the start routine etc. Can any one help me with this?
    Looking for some basic concepts of ABAP.
    Thank you,
    Kumar
    [email protected]

    Hi,
    Please check the following links that may be useful for you.
    http://help.sap.com/saphelp_46c/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4493c4a6-0301-0010-62a2-efd6ded61e04https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/60cecb1d-0a01-0010-8289-b14fd99062fa
    http://www.bwexpertonline.com/downloads/ABAPCodeforRuvinskyarticle.doc
    http://www.bwexpertonline.com/downloads/Extractor_Source_Code.doc
    http://www.bwexpertonline.com/downloads/Nissen.doc
    https://www.sdn.sap.com/irj/sdn/abap
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.sapgenie.com/faq/abap.htm
    Regards,
    ®

  • Back ground job needed to scheduled immedietly using ABAP coding

    is there anything in ABAP coding in JOB_OPEN and JOB_SUBMIT, i can trigger immedtiely ,i need not to goto SM#& and do manualy
    please help me in this
    thanking you 'sridhar

    Hi,
    I use parameter STRTIMMED  with function module JOB_CLOSE.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname          = local_job-jobname
        IMPORTING
          jobcount         = local_job-jobcount
        EXCEPTIONS
          cant_create_job  = 1
          invalid_job_data = 2
          jobname_missing  = 3
          OTHERS           = 4.
    SUBMIT abap
              WITH param = p_param AND RETURN TO SAP-SPOOL
                    VIA JOB local_job-jobname NUMBER local_job-jobcount
                  WITHOUT SPOOL DYNPRO
                  DESTINATION 'ZMD'
                  IMMEDIATELY ' '
                  KEEP IN SPOOL 'X'.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = local_job-jobcount
            jobname              = local_job-jobname
            strtimmed            = 'X'
            targetserver         = w_sys
    Cheers
    Allan

  • Abap coding in SAP query (SQ01)

    Hi,
    By using the a table like for MSEG if i want to retrieve data for the movement type 101 (receipts from vendor), i can build a query using this table and retrieve data - my problem starts when the system shows individual line items instead of cumulated result as mentioned in the following example.
    Example :-
    for the date 01.07.2007 - i have 10 entries (101 movement) of quantity 1,2,3,4,5,6,7,8,9,10 against a vendor V1. - the query lists all the 10 entries.
    But what is required is the cumulated entry against the vendor like shown below
    vendor    receipt
    V1         55.
    What abap coding should be written (provide the sample code) and the where should it be written in the query transaction SQ01
    Regards,
    M.M

    Hi Magesh,
    If you do not wish to see the detail lines, then you do not need to create them.  Just create the Statistics portion only.
    If you wish to see 'summarized Vendor quantity by day', then you might sort on Vendor first, then posting date second.  Or, vice versa, depending on your business requirement.  I would think that you might also wish to include Material in the sort, since each Material is probably valued differently.
    For more info on creating statistics in SAP Query, refer to
    http://help.sap.com/erp2005_ehp_02/helpdata/en/d2/cb4256455611d189710000e8322d00/frameset.htm
       Regards,
       Bruce

  • Not viewing links/coding issue

    I used iweb08 to design a website. It always displayed fine in any web browser (ie safari or explorer etc) and a Mac or a PC could view it. When I upgraded to iweb09 only PCs seem to be able to view the links on top of the home page and Macs cannot view the links on the homepage and therefore can't move around the site.
    I contacted the domain company (Hostess) and they gave me the following advice:
    "The problem you are having is a coding issue. You'll have to either consult the makers of the program (Apple iLife'09) or a web developer to find the best way to resolve this issue. Different browsers (Internet Explorer, Firefox, Safari) use different methods of displaying content and depending how the content is coded, you can run into problems like this where it shows up in one browser but not another."
    This would make sense to me if the PC couldn't see the links, but I don't understand why a Mac cannot view a page made on iweb and browsing in safari!
    If anyone has any advice I would be more than grateful.

    After talking to www.hostess.com.au again the problem was suddenly fixed, although they still claimed it was a "coding issue".

  • ABAP-Coding for EVERY Key figure in infocube 0RT_C02

    Hello gurus;
          Does anybody know which is the reason for Abap-coding for every key figure in infocube 0rt_c02 from InfoSource 2lis_13_vditm?
    Thanks in advanced!
    Csr

    Hi,
    this is done like this in the business content because the extractor is providing the data with a process key; this process key is then translated into meaningfull business objects (key figures);
    fro instance ProcessKey 202 in application SD is reflecting Credit memos:
    * Credit Memo
      IF COMM_STRUCTURE-PROCESSKEY = '202'
        AND COMM_STRUCTURE-BWAPPLNM EQ 'SD'.
    * currency convert
        IF COMM_STRUCTURE-COST <> 0.       "Value in document UNIT
          PERFORM LOC_CURR_CONVERT
            USING    COMM_STRUCTURE-COST   "Value in doc UNIT
                     COMM_STRUCTURE-TRANS_DATE     "Date for exchange
                     COMM_STRUCTURE-DOC_CURRCY     "Document Currency
                     COMM_STRUCTURE-LOC_CURRCY     "Local currency
    *                COMM_STRUCTURE-EXCHG_RATE     "Exchanging rate
                     COMM_STRUCTURE-/BIC/ZEXRATEAC "Exchanging rate Acctn
            CHANGING RESULT.
    * the KPI's must be turned to positive because the SD-extractors
    * allways deliver them neg. if it's a process back (e.g. return order)
          RESULT = RESULT * ( -1 ).
          UNIT = COMM_STRUCTURE-LOC_CURRCY.
    * if the returncode is not equal zero, the result will not be updated
          RETURNCODE = 0.
        ELSE.
    * if the returncode is not equal zero, the result will not be updated
          RETURNCODE = 4.
        ENDIF.
      ELSE.
    * if the returncode is not equal zero, the result will not be updated
        RETURNCODE = 4.
      ENDIF.
    the above routine is quite self explaining the code.
    hope this helps...
    Olivier.
    Message was edited by:
            Olivier Cora

  • Difference between 3X and 7X routine in term of ABAP coding

    Hi to all,
    Please can any one tell me?
    What is difference between 3X and 7X routine, in technical aspect (ABAP coding).
    I shall be thankful to you for this.
    Regards
    Pavneet Rana

    Hi Rana,
    Check the below link
    [Differences in Routine Concepts in BW3.x n Bi7.0|http://help.sap.com/saphelp_nw2004s/helpdata/en/44/bd9b5be97c112ce10000000a11466f/content.htm]
    Regards
    KP

  • How to use API to trigger JAM group invitation in ABAP coding?

    Hi,
    We want to trigger a JAM group invitation URL to be sent out in ABAP coding to enable a auto. process at backend. Currently I only know the manual way: clicking invite button in jam group and input user name to find target user and then click send button to send out invitation email.
    But question is how to do in ABAP coding to call any API to realize the same action?
    Many thanks and Best regards,
    Long

    As an ABAP developer you can make use of the SAIL Library to integrate with SAP Jam. With SAIL integrating with SAP Jam is as easy as calling a ABAP OO method. SAIL takes care of the communication with SAP Jam and handles user authentication for you.
    The lower part of http://scn.sap.com/docs/DOC-55050 contains information for ABAP developers like the SAIL developer guide and the SAIL config guide.

  • What is difference among F5 and F6 and F7 in ABAP coding?

    what is difference among F5 and F6 and F7 in ABAP coding ?  Can u give me any example regarding this thread ?

    Some additional info which can be quite helpful.
    a watchpoint is an indicator in a program that tells the ABAP runtime processor to interrupt the program at a particular point. Unlike breakpoints, however, watchpoints are not activated until the contents of a specified field change. Watchpoints, like dynamic breakpoints, are user-specific, and so do not affect other users running the same program. You can only define watchpoints in the Debugger.
    Use
    You set watchpoints in the Debugger to monitor the contents of specific fields. They inform you when the value of a field changes. When the value changes, the Debugger interrupts the program.
    Features
    · You can set up to five watchpoints in a program.
    See also Setting Watchpoints.
    · You can also specify the conditions under which a watchpoint is to become active.
    · You can specify a logical link for up to five (conditional) watchpoints.
    See also Specifying Logical Links.
    · You can define watchpoints as either local or global. If you define a global watchpoint, it is active in all called programs. Local watchpoints are only active in
    the specified program.
    · You can change and delete watchpoints.
    See Changing Watchpoints
    · You can use watchpoints to display changes to the references of strings, data and object references, and internal tables.
    See Memory Monitoring with Watchpoints
    Breakpoints
    Apart from being able to execute an ABAP program in the Debugger, you can also start the Debugger call by the choosing a breakpoint. This is achieved by setting one or more of these breakpoints in the program. A breakpoint is a signal at a particular point in the program that tells the ABAP runtime processor to interrupt processing and start the Debugger. The Debugger is activated when the program reaches this point.
    There is also a special kind of breakpoint called a watchpoint. When you use watchpoints, the Debugger is not activated until the contents of a particular field change. For more information, refer to the chapter Watchpoints.
    Breakpoint Variants
    The Debugger contains different breakpoint variants:
    Static
    A user-specific breakpoint is inserted in the source code as an ABAP statement using the keyword BREAK-POINT. A non user-specific breakpoint is set in the ABAP Editor using the BREAK user name statement.
    Directly set
    dynamic breakpoints
    Can be set in the ABAP Editor or the Debugger by double-clicking a line, for example. Dynamic breakpoints are always user-specific, and are deleted when you log off from the R/3 System.
    Breakpoints
    at statements
    The Debugger stops the program immediately before the specified statement is executed.
    Breakpoints
    at subroutines
    The Debugger stops the program immediately before the specified subroutine is called.
    Breakpoints at function modules
    The Debugger stops the program immediately before the specified function module is called.
    Breakpoints at methods
    The Debugger stops the program immediately before the specified method is called.
    Breakpoints at exceptions and system exceptions
    The Debugger stops the program immediately after a system exception, that is, after a runtime error has been intercepted.
    Static Breakpoints
    Static breakpoints are always user-independent if there is no specification of a user name. Once a user has inserted the statement BREAK-POINT or BREAK name in an ABAP program, the system always interrupts the program at that point for that user or only for the user name. This procedure is only useful in the development phase of an application when program execution is always to be interrupted at the same place. For more information, refer to the chapter Static Breakpoints.
    In HTTP sessions, a static breakpoint is skipped if you did not set additional dynamic HTTP breakpoints in the editor of a BSP page. Instead, a corresponding system log entry is written, which can be checked using transaction SM21.
    Dynamic Breakpoints
    Dynamic breakpoints are user-specific. Therefore, you should use them if you only want the program to be interrupted when you run it yourself, not when it is being executed by other users. All dynamic breakpoints are deleted when you log off from the R/3 System.
    Dynamic breakpoints are more flexible than static breakpoints because you can deactivate or delete them at runtime. They have the following advantages:
    · You do not have to change the program code.
    · You can set them even when the program is locked by another programmer.
    · You can define a counter that only activates the breakpoint after it has been reached.
    Special dynamic breakpoints are useful when you want to interrupt a program directly before a particular ABAP statement, a subroutine, or an event, but do not know exactly where to find it in the source code. Event here is used to refer to the occurrence of a particular statement, for example, or calling up a method. Special dynamic breakpoints are user-specific. You can only set them in the Debugger. For more information, refer to the chapter Dynamic Breakpoints.
    In HTTP sessions, the system stops both at static and dynamic breakpoints if a dynamic breakpoint was set in the editor of a BSP page before program execution.
    Lifetime and Transfer of Breakpoints
    A static breakpoint remains intact as long as the BREAK-POINT or BREAK-POINT name statement is not removed from the source code. Without saving, dynamic breakpoints only remain intact in the relevant internal session. However, they remain in effect during the entire user session if they are saved by choosing the menu path Breakpoints ® Save in the ABAP Debugger. For more details on the subject of user sessions and modes, refer to Modularization Techniques in the ABAP keyword documentation.
    If you call an HTTP session during a user session, only the HTTP breakpoints are loaded when the HTTP session is started. You activate HTTP debugging in the ABAP Editor by choosing Utilities ® Settings ® HTTP Debugging. Depending on the setting, the system then displays either the HTTP or standard breakpoints in the Editor.
    If you call an update session during a user session, breakpoints that were defined beforehand in the calling processing unit are copied to the new update session, where they can be displayed under Breakpoints. If, in the ABAP Debugger, you check Update Debugging under Settings and then, for example, call the update module func using CALL FUNCTION func IN UPDATE TASK, a new window is opened in which you can debug this function module in the update session. All the breakpoints that were set in the calling processing unit can also be processed here.
    we can keep them at :
    Statements
    Subroutines
    Function Module Calls
    at Methods
    System Exceptions
    break point :
    we can start debugging from that point or if we keep break point at some place we can directly got ot htat point using f6.
    watch point: for example if we have to check the output for 4000 records based on a field value i.e.for vendor number 'in'we have to check then we will create watchpoint on field LIFNR value '2000'. then we can directly go to vendor whose numbe ris 2000

Maybe you are looking for