ABAP Code Endmethod missing error??

Hi Friends,Please help me. I am not having logsys/source system id field in source datasource , hence i trying to populate that in BI . I have wriiten the code in start routine which give me <b>ENDMETHOD MISSING error</b>, as below.
please tell what i am missing to eliminate the error <b>endmethod</b>
FORM STARTROUTINE.
USING G_S_MINFO TYPE RSSM_S_MINFO
CHANGING DATAPAK type TAB_TRANSTRU
G_T_ERRORLOG TYPE rssm_t_errorlog_int
    ABORT LIKE SY-SUBRC.
RESULT = G_S_MINFO-LOGSYS.
or
LOOP AT DATAPAK INTO l_s_datapak_line.
  l_s_datapak_line-zzsourcsys = G_S_MINFO-LOGSYS.
  MODIFY DATAPAK FROM l_s_datapak_line.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
Poonam Roy

Use this....
FORM STARTROUTINE
   USING G_S_MINFO TYPE RSSM_S_MINFO
   CHANGING DATAPAK type TAB_TRANSTRU
                     G_T_ERRORLOG TYPE rssm_t_errorlog_int
                     ABORT LIKE SY-SUBRC.
RESULT = G_S_MINFO-LOGSYS.
LOOP AT DATAPAK INTO l_s_datapak_line.
l_s_datapak_line-zzsourcsys = G_S_MINFO-LOGSYS.
MODIFY DATAPAK FROM l_s_datapak_line.
ENDLOOP.
ENDFORM.
Reward if helpful...

Similar Messages

  • Routine (ABAP Code)  in Transformation error

    Hi Experts
    Please correct the ABAP CODE written as Field routine in Transformations
    Requirment
    If  ZB_AMT = '0.00'
    then result should be '0.00'
    If  ZB_AMT <> '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT'
    the result should be
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    If  ZB_AMT <> '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE'
    the result should be
    CONCATENATE  SOURCE_FIELDS-/BIC/ZB_AMT  '%' INTO RESULT.
    The code below is not working as it should please update me where i went wrong
    Source Fields
    SOURCE_FIELDS-/BIC/ZB_AMT (CHAR)
    SOURCE_FIELDS-/BIC/ZB_TPE1 (CHAR)
    CODE
    IF SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
          RESULT = '0.00'.
        ELSE.
          IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' AND
             SOURCE_FIELDS-/BIC/ZB_AMT <> '0.00'.
            CONCATENATE '$' SOURCE_FIELDS-/BIC/ZBON_AMT INTO RESULT.
            IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE' AND
               SOURCE_FIELDS-/BIC/ZB_AMT <> '0.00'.
              CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
            ENDIF.
          ENDIF.
        ENDIF.

    Your logic will not work, if your first check on amount is 0.00 fails, the other checks fail as well. I am not sure of the requirement but..try this..
    IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' AND SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZBON_AMT INTO RESULT.
    ELSEIF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE' AND SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    ELSEIF SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
      RESULT = '0.00'.
    ELSE.
    Do nothing or throw any message
    ENDIF.

  • Error in the ABAP code

    Hello all,
    I am getting error in ABAP code .
    The error is:Field "0" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
    I have statement as calmonth = sy-datum + 0(6).
    Any ideas are always welcome
    Thanks,
    JB

    Thanks every body.
    eliminating blanks worked.
    AS I am new to ABAP,I have one more error saying
    Unable to interpret "IT_YEAR". Possible causes of error: Incorrect spelling or comma error.The error occured at the staement:
    <b>read it_year with key /BIC/LESS = calmonth+0(4) binary search.</b>
    IT_YEAR is an internal table
    data: it_year like /BIC/PZ_JB occurs 0 with header line.
    Any ideas!!
    JB

  • Uncaught Exception occured while sending mail through abap code.

    Hi,
    Uncaught Exception occured while sending mail through abap code.Run time Errors "UNCAUGHT_EXCEPTION" occured after excuting the call method  CALL METHOD SEND_REQUEST->SEND( ).kindly help in resolving the issue.

    HI,
    Runtime Error:  UNCAUGHT_EXCEPTION details.
    Runtime Errors         UNCAUGHT_EXCEPTION
    Exception              CX_ADDRESS_BCS
    Short text
         An exception occurred that was not caught.
    What happened?
         The exception 'CX_ADDRESS_BCS' was raised, but it was not caught anywhere along
         the call hierarchy.
         Since exceptions represent error situations and this error was not
         adequately responded to, the running ABAP program 'SAPLZSEND_MAIL' has to be
         terminated.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_ADDRESS_BCS', was not caught in
        procedure "SEND_MAIL" "(FORM)", nor was it propagated by a RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        An exception occurred
    How to correct the error
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "UNCAUGHT_EXCEPTION" "CX_ADDRESS_BCS"
        "SAPLZSEND_MAIL" or "LZSEND_MAILU01"
        "ZSEND_EMAIL"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
        (Unconverted)".
        3. If the problem occurs in a problem of your own or a modified SAP
        program: The source code of the program
           In the editor, choose "Utilities->More
        Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.
    The exception must either be prevented, caught within proedure
    "SEND_MAIL" "(FORM)", or its possible occurrence must be declared in the
    RAISING clause of the procedure.
    Please help me to resolve this issue.

  • JavaScript code was missing (Configurator 2 file to 3)...

    Hi Everyone...
    I just opened a Configurator 2 file in the new 3.1 and converted it to CS6.  Now I'm getting a "JavaScript code was missing" error when I attempt to run 'Image Processor' and 'Load files into stack' scripts.  These were working just fine previously.  Unfortunately we don't have an older backup of the Configurator 2 file.
    Does anyone know of a fix for this?  A quick online search discussed a possible issue with the hard drive sharing the same name as something or other.  I can't see how it worked before and doesn't work now.  The only thing we did was open it in the latest version and convert to CS6.
    Note: We have even tried removing the old button and have replaced it with the new Configurator 3 buttons.  Still doesn't work.
    Very frustrating... and yes, it's my fault I didn't have a backup of the original Configurator 2 file.

    You know... sometimes I just want to scream. 
    So after further digging I discovered, to my wonderment, that the two scripts in question have been effectively omitted (turned off).  Could someone at Adobe please explain to us why they would do this?  Pehaps you might want to put 'Several Features Not Available' in big bold letters on the download page before people like myself go downloading the latest and greatest only to have their workflow stunted by a clear flaw in the system.  One could safely believe that at the very least, all of the features of the previous Configurator versions would be present and working in the latest release.
    Things like this add to my ever-decreasing loss of faith in mankind. 
    See below for the scripts that don't work... taken from the 'Known Issues' section of the Configurator 3.1 notes.  I'll be sure to always read the 'Known Issues' notes from now on, even though we shouldn't have to.
    [Photoshop CS6] The following HTML links to scripts do not work: [3167031]
    All of the Panel/Brush Presets section; adobe://photoshop.cs6/Panel/BrushPresets/[Close |
    CloseTabGroup | DeleteBrush | LoadBrushes | RenameBrush | ReplaceBrushes | ResetBrushes |
    SaveBrushes]
    All of the Panel/Brushes section; adobe://photoshop.cs6/Panel/Brushes/[ClearBrushControls |
    CopyTexturetoOtherTools | NewBrushPreset]
    All of the Panel/ChannelMixerAdjustment section;
    adobe://photoshop.cs6/Panel/ChannelMixerAdjustment/[Close | CloseTabGroup |
    DeleteCurrentPreset | LoadChannelMixerPreset | ResetChannelMixer | SaveChannelMixerPreset] and
    adobe://photoshop.cs6/Panel/ChannelMixerAdjustment/Auto/SelectParameter
    adobe://photoshop.cs6/Main/File/Print
    adobe://photoshop.cs6/Main/File/PrintOneCopy
    adobe://photoshop.cs6/Main/File/Scripts/ImageProcessor
    adobe://photoshop.cs6/Main/File/Scripts/LoadFilesintoStack
    adobe://photoshop.cs6/Main/File/Scripts/Statistics
    [Windows only] adobe://photoshop.cs6/Main/3D/GetMoreContent

  • HP Officejet Pro 8610 - Error Code: " 0xc19a0013" (missing or failed printhead)

    I purchased the printer (HP Officejet Pro 8610 e-All-in-one printer) in January, 2015.  The printer functioned properly - copy, fax, and scan, until two days ago.  Now, it does not print at all.  Received an error code: "0xc19a0013" (Missing or Failed Printhead).  An expanded version of the error code reads:  "The Printhead appears to be missing, not detected, or incorrectly installed.  Error Code: 0xc19a0013.   The printer uses a removable printhead, HP Ink Cartridges 950 (black) and  951(cmy).  I have used HP Support Troubleshooting recommendations: all software and firmware for this printer is installed; the HP ink cartridges are not low or empty; removed the ink cartridges from the printhead and reinstalled them.
    There are multible steps in the troubleshooting recommendation, but I stopped at removing the printhead.  Because of my technical inexperience, and there were too many ceveats (beware, caution, proper reinstallation, and etc.)  with removing the printhead that could cause greater problems.  So, I stopped at removing and cleaning the printhead.  Also, used the HP Printer Scan Doctor for assistance. The tool for cleaning the printhead doesn't work.   What troubles me most with the 0xc19a0013 error code is its explanation: The printhead appears to be missing, not detected, or incorrectly installed.  I can use all the help I can get to understand what is going on with the error code that I have received, and how to resolve the malfunctioning printer.
    This question was solved.
    View Solution.

    Contact HP technical support at 800-474-6836 for more options.
    If you live outside the US/Canada Region, please click the link below to get the support number for your region. 
    Country-language selector.
    Please mark the post that solves your issue as "Accept as Solution".
    If my answer was helpful click the “Thumbs Up" on the left to say “Thanks”!
    I am not a HP employee.

  • Error in ABAP code whield efining structures

    Hello,
    I am getting following error when I run ABAP code.
    Tables: ZROLE_OWNER, ZROLEMAP, AGR_1251, AGR_USERS.
    DATA: BEGIN OF I_ROLE occurs 0,
          ROLE LIKE ZROLE_OWNER-ROLE,
          END OF I_ROLE.
    DATA: BEGIN OF I_RATT occurs 0,
          ROLENAME LIKE AGR_1251-AGR_NAME,
          OBJECT LIKE AGR_1251-OBJECT,
          FIELD LIKE AGR_1251-FIELD,
          LOW LIKE AGR_1251-LOW,
          HIGH LIKE AGR_1251-HIGH,
          END OF I_RATT.
    DATA: WA_RATT LIKE I_RATT occurs 0.
    SELECT ROLE from ZROLE_OWNER into table I_ROLE
                where SFLAG = ''.
    LOOP AT I_ROLE.
    *This will append all the values for above condition in WA-RATT.
    SELECT AGR_NAME OBJECT FIELD LOW HIGH FROM AGR_1251
                 INTO TABLE WA_RATT
                 WHERE AGR_NAME = I_ROLE-ROLE.
    APPEND WA_RATT TO I_RATT.
    ENDLOOP.
    I am getting error that WA_RATT cannot be converted to line type I_RATT.

    hi,
    Tables: ZROLE_OWNER, ZROLEMAP, AGR_1251, AGR_USERS.
    DATA: BEGIN OF I_ROLE occurs 0,
    ROLE LIKE ZROLE_OWNER-ROLE,
    END OF I_ROLE.
    DATA: BEGIN OF I_RATT occurs 0,
    ROLENAME LIKE AGR_1251-AGR_NAME,
    OBJECT LIKE AGR_1251-OBJECT,
    FIELD LIKE AGR_1251-FIELD,
    LOW LIKE AGR_1251-LOW,
    HIGH LIKE AGR_1251-HIGH,
    END OF I_RATT.
    DATA: WA_RATT LIKE line of I_RATT .
    SELECT ROLE from ZROLE_OWNER into table I_ROLE
    where SFLAG = ''.
    LOOP AT I_ROLE.
    *This will append all the values for above condition in WA-RATT.
    SELECT AGR_NAME OBJECT FIELD LOW HIGH FROM AGR_1251
    INTO WA_RATT
       up to 1 rows
    WHERE AGR_NAME = I_ROLE-ROLE.
    endselect.
    APPEND WA_RATT TO I_RATT.
    ENDLOOP.
    Thanks,
    Rajinikanth.

  • Error in ABAP code generation?

    Hi,
    I am using OWB 10.1 to generate ABAP code for SAP-Data-Extraction. For extracting date values there are two APAB lines which (want to) produce one line in the result SQLLDR-Script. ABAP will accept only around 73 characters per line and this is the reason for the two lines.
    But ABAP does not accept a line break inside a string and thus this code runs into an ABAP-error.
    This all seems to be standard - has anyone a solution?
    generated ABAP-lines:
    Line1: TRANSFER ',ERDAT_DATUM_AN_DEM_DER_SATZ_HI DATE ''yyyymmdd'' NULLIF
    Line2: ERDAT_DATUM_AN_DEM_DER_SATZ_HI=''00000000''' TO DATAFILENAME.
    many thanks

    Hello Jean-Pierre,
    many thanks for your answer. Not the expected solution but it works. Another solution we found is to put an ampersand behind the first line, which tells ABAP that this is a line break. But also here manually work is necessary and also changing generated code.
    Cheers
    Stefan

  • LKM SAP BW to Oracle (SQLLDR) generates sintax error in ABAP code.

    Hi Experts,
    We are installing a SAP BW KM's in ODI 11g.
    Actually, we are able to make reverse ingeneering succesfully.
    Now we want to use the LKM in order to extract SAP data.
    The KM fails, in step Generate ABAP Code. The code is uploaded to SAP system but with sintaxis errors.
    That's the beginning of the SAPAbapExecuteOpenTool_8001_7001.log.
    +##################################################+
    +############ Open Tool Logger ####################+
    +##################################################+
    +############ Upload value: 1+
    +############ Execute value: 1+
    +############ BASE RKM FLAG: 0+
    +############ ZRFC_RUN_INSTALL: 1+
    +############ Abap Function Name: ZODI_8001_7001+
    +############ Sap Host Name: XXXXXXXX+
    +############ Sap User Name: XXXX+
    +############ Sap password: ********+
    +############ Sap Client: 100+
    +############ Sap language: ES+
    +############ Sap system no: 00+
    +############ Sap Connection Pool Name: SAP_ODI_LKM_POOL_GLOBAL+
    +############ Sap Connection Pool Size: 10+
    +############ Sap Function group name: ZODIBW_LKM_FGRP+
    +############ File Delimiter:+
    +############ File Name: ZODI_8001_7001.txt+
    +############ FTP Host: XXXXXXXXX+
    +############ FTP User: ftpbi+
    +############ FTP Password: ********+
    +############ FTP Passive Mode: 1+
    +############ FTP Transfer Time out: 100000+
    +############ User abap parameter names: IV_DELIMITER,CHAR1;IV_FILENAME,CHAR255;IV_USER,CHAR35;IV_PWD,CHAR35;IV_HOST,CHAR35;IV_HASHVALUE,CHAR35;IV_PATH,CHAR35;IV_REQUID_L,RSSID;IV_REQUID_H,RSSID+
    +############ Abap rfc table parameters: RETURN,BAPIRETURN;ET_FILE_RETURN,BAPIRET2+
    +############ Log File Name: /tmp/SAPAbapExecuteOpenTool_8001_7001.log+
    +############ OpenHub Path: /tmp/+
    +############ Delta Extraction First Request ID : 0+
    +############ Delta Extraction Last Request ID : 0+
    +############ SAP Development Class : ZODIBW_PCKG+
    +############ Max Row Count :+
    +############ Fetch Batch Size :+
    +############ Hash Value Marker: HVM+
    +############ Generated Program:+
    *** ODS DSO extraction
    TYPES: BEGIN OF ty_final,
    +/BIC/AZOFI_UTE00_/BIC/ZFI_SOCOR+
    TYPE
    +/BIC/AZOFI_UTE00-/BIC/ZFI_SOCOR,+
    +/BIC/AZOFI_UTE00_SOURSYSTEM+
    TYPE
    +/BIC/AZOFI_UTE00-SOURSYSTEM,+
    END OF ty_final.
    In the SAP GUI shows a sintaxis error.
    Functions Module ZODI_8001_7001. line 25
    The name "/BIC/AZOFI_UTE00_/BIC/ZFI_SOCOR" is longer that allowed.
    +30 characters.+
    Really the TYPE "/BIC/AZOFI_UTE00_/BIC/ZFI_SOCOR" has 31 characters.
    The sufix "/BIC/" is the "NAMESPACE", a SAP grouping concept.
    AZOFI_UTE00 is a table name.
    ZFI_SOCOR is a column name.
    Are this sufix correct in the APAP code?
    Has anyone had that problem?
    Any comment will be wellcome.
    Thank's in advance.

    Hi Somchai,
    r U able to resolve ur issue ..........i'm also struck there at the same point.
    I am using shared folder for file transfer and my error message is
    java.lang.RuntimeException: Error occured in open tool execute method...Error in executing ABAP program...Error in executing ABAP program...Error occurred when creating dataset\\<hostname>\bi-interface$\ZODI_11001_12001_GLOBAL.txt
    Thanks.
    Edited by: Drona on Mar 26, 2012 7:25 AM

  • Error in determining Paper Format for Printout triggering from ABAP Code

    Hi Experts,
    I am trying to trigger a printout from my ABAP code using "NEW-PAGE PRINT ON ...... NEW-PAGE PRINT OFF" statement.
    I am passing the Print Parameters using the FM "GET_PRINT_PARAMETERS" as below:
        CALL FUNCTION 'GET_PRINT_PARAMETERS'
          EXPORTING
            destination    = ls_options-tddest
            copies         = 1
            list_name      = 'Notification'
            list_text      = 'ERROR NOTIFICATION'
            immediately    = 'X'
            release        = 'X'
            new_list_id    = ' '
    *        expiration     =
            line_size      = 79
            line_count     = 23
            layout         = 'X_65_80'
            sap_cover_page = ' '
            receiver       = 'SAP*'
            department     = 'System'
            no_dialog      = 'X'
          IMPORTING
            out_parameters = lv_params.
    But I am facing a problem. Though I am passing X_65_80 to the LAYOUT in the Function Module, it is trying to print in LETTER format. But the specified printer as the printer supports only A4 paper format and as a result, I am not getting any printout.
    Kindly help me with your suggestions to resolve this.
    Thanks in advance.
    Regards,
    Keerthi

    Hi,
    I just found that this problem is even stranger.
    I am able to print the said message on my local printer but when I try to print the same message on a different printer located at a different location, the printout does not get triggered. I am not getting any error messages also in this case.
    What could be the possible reason for this?
    Kindly share your views/experience with me on this one.
    Thank you.
    Regards,
    Keerthi

  • ABAP/4 run time error with error code  SNAP_NO_NEW_ENTRY

    Dear All,
               I've installed SAP R/3 IDES on Oracle on Windows 2003 server.After clicking Log on button , I should be asked to enter client,user and password.But, my system does not display such details.Instead I get ABAP/4 run time error with error code  SNAP_NO_NEW_ENTRY that too after a long time.
                Can you please address what is the reason for this problem and how to over ride it?
    Regards,
    S.Suresh

    Hi,
    the most probable reason is an archiver stuck. Backup the archived redo log files and delete them afterwards.
    The database will archive some more logs after this. Handle them in the same manor. For complete explanation search for brtools.
    Regards
    Ralph Ganszky

  • How find the ABAP code with Error message

    Hi
    How to  find the ABAP Code for Error Message?
    Example:
    Error Message: ZF026.
    Regards
    Odaiah Pelley
    Edited by: Odaiah Pelley on Aug 22, 2008 4:21 AM

    Hi
    Excellent Answer, I appreciate it.
    My question is with Error Message ZF026.
    How to find ABAP Code ?
    If I go for SE91 I will get same message as if I am getting error message.It is no use.
    Regards
    Odaiah Pelleyu

  • FieldPoint error codes list missing

    Hi everybody,
       Here 
           http://zone.ni.com/reference/en-XX/help/371361A-01/lverror/error_code_ranges/
       you can find a list of LabVIEW error codes;  in the list, the FieldPoint error code section is missing.
       Opening Extended Optomux VIs, opening SerialHandler (VISA).vi, I reached a point containing error codes, which ranges from 32896 to  33026 (or something like that......). 
       On Field Point Programmer reference, optomux errors goes from 00 to 8C. 
       What am I getting in "error code" field of error out
    terminal of extended optomux VIs?  Is there a list with complete
    errors?
       More: what is the link between Status word (the one
    obtained from "Write discrete with status") and error codes? Is it
    simply "1"  when some error is detected?
       It's quite important to have a deep knowledge of errors when you build an embedded critical application.....
       Thank you for helping me!
    graziano.

    Hi AlessioD,
        If you expand all the sub-VIs, starting from, say, (!J)Read Discrete (VISA).vi, that is an optomux VI, you'll reach Serial Handler (VISA).vi.  There you find the error generation.  The numbers assigned to errors seems not to be like constants defined in FP-1000 Programmer Reference Manual.
       In FP-1000 Programmer Reference Manual, for example, E_PUCLR_EXP error (power up clear expected error) has an Error Number (Hex) 00 (page 2-2).
       In the picture below, it seems that a Power up clear error has an error 32896 (resembles much a VISA error code...).
        Is there an utility to get Optomux error codes from General errors?  I mean, errors reported from optomux VIs.
       Thanks!
    graziano
    Attachments:
    forum_0.JPG ‏132 KB
    optomux VI_1.JPG ‏7 KB

  • Error in the ABAP Code for Customer Exit Variable

    Could you please update me what is the wrong with the below ABAP Code developed for Customer Exit Variable in BW
    i created a Variable (ZVWKNO) of Customer Exit,Single Value ,Mandatory and Variable is ready for input
    In CMOD i had written the below Code:
    When 'ZVWKNO'.
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    But when i execute the query the default value is not populated with Week-1 No in the variable screen
    Please update me what went wrong
    Thanks

    Case ZVWKNO.                "write this with out comments
    When '1'.              "write the value that needs to equal with value in varaible ZVWKNO after when in sungle quotes
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.                                    "check this Week Minimum is '01' and Maximum '52'
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    Prabhudas

  • ABAP code error.

    Dear Experts,
    In the below abap code i am facing the problem of goods returns and other issues.
    becoz of that my code add the qty & value of that invoices.
    please give me suggestion.
    Please go through the bold area.
    SELECT-OPTIONS : s_spart FOR vbrk-spart,
                     s_kunag FOR vbrk-kunag,
                    s_fkdat FOR vbrk-fkdat OBLIGATORY.
    *--end of selection--
    SELECT vbrk~spart
           vbrk~vbeln
           vbrk~kunag
           vbrk~kurrf
           vbrk~netwr
           vbrk~fkdat
           vbrp~mwsbp
           vbrp~fkimg
           vbak~auart
      INTO CORRESPONDING FIELDS OF TABLE i_vbrk
      FROM vbrk
      INNER JOIN vbrp
      ON vbrpvbeln = vbrkvbeln
      INNER JOIN vbak
      on vbakvbeln = vbrpaubel
      WHERE vbrk~spart IN s_spart
      AND   vbrk~kunag IN s_kunag
      AND   vbrk~fkdat IN s_fkdat
      AND VBRK~VBTYP IN ('M','O','P')
      AND   vbrk~vkorg  = 'JS01'
      AND   vbrk~fksto  NE 'X'
      AND   vbrk~rfbsk  = 'C'.
    SELECT  knkk~kunnr
            knkk~klimk
            kna1~name1
      INTO CORRESPONDING FIELDS OF TABLE i_knkk
      FROM knkk
      INNER JOIN kna1
      ON knkkkunnr = kna1kunnr
      WHERE kna1~kunnr IN s_kunag.
    LOOP AT i_vbrk.
      IF i_vbrk-auart = 'ZJCR' OR i_vbrk-auart = 'ZJDR' OR i_vbrk-auart = 'ZJC1'.
        CLEAR i_vbrk-fkimg.
        clear i_vbrk-vlinr.
        ENDIF.
      IF i_vbrk-mwsbp <> 0.
        i_vbrk-netwr = i_vbrk-netwr + i_vbrk-mwsbp.
      ENDIF.
      IF i_vbrk-kurrf <> 1.
        *i_vbrk-vlinr = i_vbrk-netwr * i_vbrk-kurrf.*
      ELSE.
        i_vbrk-vlinr = i_vbrk-netwr.
      ENDIF.
    IF i_vbrk-auart = 'ZJRE'
       OR i_vbrk-auart = 'ZJCR'
       OR i_vbrk-auart = 'ZJC1'
       OR i_vbrk-auart = 'ADTC'
       OR i_vbrk-auart = 'ZJR1'
       OR i_vbrk-auart = 'ZJKR'
       OR i_vbrk-auart = 'ZJBR'.
         it_main-netwr = it_main-netwr * -1.*
          *i_vbrk-vlinr = i_vbrk-vlinr * -1.*
          *i_vbrk-fkimg = i_vbrk-fkimg * -1.*
          ENDIF.
      CLEAR :i_vbrk-mwsbp, i_vbrk-netwr, i_vbrk-kurrf." i_vbrk-fkimg.
      MODIFY i_vbrk. "INDEX V_INDEX.
    ENDLOOP.
    LOOP AT i_vbrk.
    MOVE I_VBRK-KUNAG TO I_FINAL-KUNNR.
    MOVE I_VBRK-FKDAT TO I_FINAL-FKDAT.
    MOVE I_VBRK-FKIMG TO I_FINAL-FKIMG.
        clear i_vbrk-auart.
      IF i_vbrk-fkdat+4(02) = '01'.
       i_KNKK-month = 'JAN'.
        i_vbrk-janq = i_vbrk-fkimg.
        i_vbrk-jana = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '02'.
       i_KNKK-month = 'FEB'.
        i_vbrk-febq = i_vbrk-fkimg.
        i_vbrk-feba = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '03'.
       i_KNKK-month = 'MAR'.
        i_vbrk-marq = i_vbrk-fkimg.
        i_vbrk-mara = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '04'.
       i_KNKK-month = 'APR'.
        i_vbrk-aprq = i_vbrk-fkimg.
        i_vbrk-apra = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '05'.
       i_KNKK-month = 'MAY'.
        i_vbrk-mayq = i_vbrk-fkimg.
        i_vbrk-maya = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '06'.
       i_KNKK-month = 'JUN'.
        i_vbrk-junq = i_vbrk-fkimg.
        i_vbrk-juna = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '07'.
       i_KNKK-month = 'JUL'.
        i_vbrk-julq = i_vbrk-fkimg.
        i_vbrk-jula = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '08'.
       i_KNKK-month = 'AUG'.
        i_vbrk-augq = i_vbrk-fkimg.
        i_vbrk-auga = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '09'.
       i_KNKK-month = 'SEP'.
        i_vbrk-sepq = i_vbrk-fkimg.
        i_vbrk-sepa = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '10'.
       i_KNKK-month = 'OCT'.
        i_vbrk-octq = i_vbrk-fkimg.
        i_vbrk-octa = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '11'.
       i_KNKK-month = 'NOV'.
        i_vbrk-novq = i_vbrk-fkimg.
        i_vbrk-nova = i_vbrk-vlinr / 100000.
      ENDIF.
      IF i_vbrk-fkdat+4(02) = '12'.
       i_KNKK-month = 'DEC'.
        i_vbrk-decq = i_vbrk-fkimg.
        i_vbrk-deca = i_vbrk-vlinr / 100000.
      ENDIF.
    MODIFY i_KNKK.
      MODIFY i_vbrk. "INDEX V_INDEX.
    ENDLOOP.
    CLEAR : i_VBRK-FKDAT, i_vbrk-vbeln.
    DATA : ii_vbrk LIKE i_vbrk OCCURS 0 WITH HEADER LINE.
    LOOP AT i_VBRK.
      CLEAR : i_VBRK-FKDAT, i_vbrk-vbeln,i_vbrk-auart.
      COLLECT i_vbrk INTO ii_vbrk.
    MODIFY i_VBRK.
    ENDLOOP.
    *LOOP AT i_knkk.
    IF i_final-kunag =  knkk-kunnr.
       APPEND i_final.
    ENDIF.
    *ENDLOOP.
    DATA : V(3) TYPE C.
    CLEAR v_index.
    LOOP AT ii_vbrk.
    v_index = sy-TABIX.
    READ TABLE i_knkk WITH  KEY kunnr = ii_vbrk-kunag.
    IF SY-SUBRC = 0.
        MOVE i_knkk-klimk TO ii_vbrk-klimk.
        MOVE i_knkk-name1 TO ii_vbrk-name1.
       MOVE I_KNKK-MONTH TO II_VBRK-MONTH.
      MODIFY ii_vbrk INDEX v_index.
    ENDIF.
    ENDLOOP.
    LOOP AT ii_vbrk.
      ii_vbrk-klimk = ii_vbrk-klimk / 100000.
      II_VBRK-VLINR = II_VBRK-jana + II_VBRK-feba + II_VBRK-mara + II_VBRK-apra + II_VBRK-maya + II_VBRK-juna + II_VBRK-jula + II_VBRK-auga + II_VBRK-sepa + II_VBRK-octa + II_VBRK-nova + II_VBRK-deca.
      PEAK_QTY = II_VBRK-JANQ.
      PEAK_AMT = II_VBRK-JANA.
      PEAK_MONTH = 'JAN'.
      IF PEAK_AMT LT II_VBRK-FEBA.
         PEAK_QTY = II_VBRK-FEBQ.
         PEAK_AMT = II_VBRK-FEBA.
         PEAK_MONTH = 'FEB'.
         ENDIF.
         IF PEAK_AMT LT II_VBRK-MARA.
         PEAK_QTY = II_VBRK-MARQ.
         PEAK_AMT = II_VBRK-MARA.
         PEAK_MONTH = 'MAR'.
         ENDIF.
         IF PEAK_AMT LT II_VBRK-APRA.
         PEAK_QTY = II_VBRK-APRQ.
         PEAK_AMT = II_VBRK-APRA.
         PEAK_MONTH = 'APR'.
         ENDIF.
         IF PEAK_AMT LT II_VBRK-MAYA.
         PEAK_QTY = II_VBRK-MAYQ.
         PEAK_AMT = II_VBRK-MAYA.
         PEAK_MONTH = 'MAY'.
         ENDIF.
         IF PEAK_AMT LT II_VBRK-JUNA.
         PEAK_QTY = II_VBRK-JUNQ.
         PEAK_AMT = II_VBRK-JUNA.
         PEAK_MONTH = 'JUN'.
         ENDIF.
         IF PEAK_AMT LT II_VBRK-JULA.
         PEAK_QTY = II_VBRK-JULQ.
         PEAK_AMT = II_VBRK-JULA.
         PEAK_MONTH = 'JUL'.
         ENDIF.
         IF PEAK_AMT LT II_VBRK-AUGA.
         PEAK_QTY = II_VBRK-AUGQ.
         PEAK_AMT = II_VBRK-AUGA.
         PEAK_MONTH = 'AUG'.
         ENDIF.
         IF PEAK_AMT LT II_VBRK-SEPA.
         PEAK_QTY = II_VBRK-SEPQ.
         PEAK_AMT = II_VBRK-SEPA.
         PEAK_MONTH = 'SEP'.
         ENDIF.
         IF PEAK_AMT LT II_VBRK-OCTA.
         PEAK_QTY = II_VBRK-OCTQ.
         PEAK_AMT = II_VBRK-OCTA.
         PEAK_MONTH = 'OCT'.
         ENDIF.
         IF PEAK_AMT LT II_VBRK-NOVA.
         PEAK_QTY = II_VBRK-NOVQ.
         PEAK_AMT = II_VBRK-NOVA.
         PEAK_MONTH = 'NOV'.
         ENDIF.
         IF PEAK_AMT LT II_VBRK-DECA.
         PEAK_QTY = II_VBRK-DECQ.
         PEAK_AMT = II_VBRK-DECA.
         PEAK_MONTH = 'DEC'.
         ENDIF.
        II_VBRK-VLINR = II_VBRK-jana + II_VBRK-feba + II_VBRK-mara + II_VBRK-apra + II_VBRK-maya + II_VBRK-juna + II_VBRK-jula + II_VBRK-auga + II_VBRK-sepa + II_VBRK-octa + II_VBRK-nova + II_VBRK-deca.
         II_VBRK-FKIMG = PEAK_QTY.
         II_VBRK-peaka = PEAK_AMT.
         II_VBRK-MONTH = PEAK_MONTH.
         MODIFY II_VBRK.
      ENDLOOP.
    SORT ii_vbrk BY SPART.
    Thanks
    DSRAJPUT

    Hi,
    could you please try to format your coding nicely (see Markup Possibilities). There is also a possibility to attach files.
    BR,
    Tomislav

Maybe you are looking for