Skip to Content
author's profile photo Former Member
Former Member

Report not generated when one item selected but when more then one selected

IN my report output which shows the contacts with checkbox selection when one item si selected it gives error output but when more than one slected it gives the correcet output.

FORM process_vf01.
  DATA: ln_index(2) TYPE n,
        lc_field(20) TYPE c,
        lc_fkart TYPE vbrk-fkart,
        li_lines TYPE i,
        lc_msgtxt(99) TYPE c,
        lwa_bdcoptions TYPE ctu_params,
        lwa_mess LIKE LINE OF it_bdcmess.

  REFRESH: it_bdcmess.

  lwa_bdcoptions-dismode = cns_mode.
  lwa_bdcoptions-updmode = cns_upd.

  CASE 'X'.
    WHEN p_rdff.
      lc_fkart = cns_fkff.
    WHEN p_rdos.
      lc_fkart = cns_fkos.
  ENDCASE.

  DESCRIBE TABLE it_vbeln LINES li_lines.

  REFRESH: bdc_tab.
  PERFORM update_bdc USING: 'X' 'SAPMV60A'    '0102',
                            ' ' 'BDC_CURSOR'  'RV60A-FKART',
                            ' ' 'RV60A-FKART' lc_fkart,
                            ' ' 'BDC_OKCODE' '/00'.

  LOOP AT it_vbeln INTO wa_vbeln.
    ln_index = sy-tabix.

*   Up to the second delivery of the BDC add the Delivery to the screen,
*   after that click the More Documents for every entry.  logic changed for DEVK902353
*   changed again in added for every line DEVK910604
    CASE ln_index.
      WHEN 1.
        CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.

        IF li_lines = 1.
          PERFORM update_bdc USING: ' ' lc_field wa_vbeln.
        ELSE.
          PERFORM update_bdc USING: ' ' lc_field wa_vbeln,
*                          'X' 'SAPMV60A'   '0102',
                          ' ' 'BDC_OKCODE' 'FKAN'.
        ENDIF.
      WHEN OTHERS.
*        IF p_rdos <> 'X'.
        CONCATENATE 'KOMFK-VBELN' '(2)' INTO lc_field.
        PERFORM update_bdc USING: ' ' lc_field wa_vbeln,
                                  'X' 'SAPMV60A'   '0102',
                                  ' ' 'BDC_OKCODE' 'FKAN'..
*        endif.
    ENDCASE.

  ENDLOOP.

* VF01 will go to a different screen if only one line selected
  IF li_lines EQ 1.
    PERFORM update_bdc USING: 'X' 'SAPMV60A' '0104',
                              ' ' 'BDC_OKCODE' '=SICH'.
  ELSE.
    PERFORM update_bdc USING: 'X' 'SAPMV60A' '0102',
                              ' ' 'BDC_OKCODE' '=SICH'.
  ENDIF.

  CALL TRANSACTION 'VF01' USING bdc_tab OPTIONS FROM lwa_bdcoptions
                          MESSAGES INTO it_bdcmess.

  WRITE: / 'BDC Messages:'.
  SKIP.
  LOOP AT it_bdcmess INTO lwa_mess.

    CALL FUNCTION 'RH_MESSAGE_GET'
      EXPORTING
        arbgb             = 'VF'
        msgnr             = lwa_mess-msgnr
        msgv1             = lwa_mess-msgv1
        msgv2             = lwa_mess-msgv2
        msgv3             = lwa_mess-msgv3
        msgv4             = lwa_mess-msgv4
      IMPORTING
        msgtext           = lc_msgtxt
      EXCEPTIONS
        message_not_found = 1
        OTHERS            = 2.

    WRITE: /5 lc_msgtxt.

  ENDLOOP.


ENDFORM.                    " process_vf01

Can someone please help out on this issue.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 20, 2009 at 11:37 PM

    where is the check box selection logic..

    Debug at the point of error-generation.

    PP

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 22, 2009 at 07:11 PM

    Hi,

    Please check if this statement is correct...

    WHEN OTHERS.

    • IF p_rdos 'X'.

    CONCATENATE 'KOMFK-VBELN' '(2)' INTO lc_field.

    " should this statement be concatenated with '2' or with 'index value'.

    PERFORM update_bdc USING: ' ' lc_field wa_vbeln,

    'X' 'SAPMV60A' '0102',

    ' ' 'BDC_OKCODE' 'FKAN'..

    • endif.

    ENDCASE.

    if this is fine please do let me know...

    Regards,

    Siddarth

    Edited by: Siddharth Chordia on Feb 22, 2009 8:11 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 23, 2009 at 11:00 PM

    Hi,

    Would you please paste the code of your subroutine update_bdc to have a look into it

    Regards

    Siddarth

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Also try with this one as well

      PERFORM update_bdc USING: 'X' 'SAPMV60A'   '0102'.
      LOOP AT it_vbeln INTO wa_vbeln.
          ln_index = sy-tabix.
      " Use if condition if its necessary for item selection purpose
          CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
          PERFORM update_bdc USING: ' ' lc_field wa_vbeln.
      ENDLOOP.
      PERFORM update_bdc USING ' ' 'BDC_OKCODE' 'FKAN'.
      * VF01 will go to a different screen if only one line selected
      *  IF li_lines EQ 1.
      *    PERFORM update_bdc USING: 'X' 'SAPMV60A' '0104',
      *                              ' ' 'BDC_OKCODE' '=SICH'.
      *  ELSE.
          PERFORM update_bdc USING: 'X' 'SAPMV60A' '0102',
                                    ' ' 'BDC_OKCODE' '=SICH'.
      *  ENDIF.

      Regards,

      Siddarth

  • author's profile photo Former Member
    Former Member
    Posted on Feb 23, 2009 at 11:21 PM

    Hi,

    Try using the case which is given below instead of the case statement you have used......

    PERFORM update_bdc USING: 'X' 'SAPMV60A'   '0102'.
    LOOP AT it_vbeln INTO wa_vbeln.
        ln_index = sy-tabix.
    " Use if condition if its necessary for item selection purpose
        CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
        PERFORM update_bdc USING: ' ' lc_field wa_vbeln.
    ENDLOOP.
    PERFORM update_bdc USING ' ' 'BDC_OKCODE' 'FKAN'.

    Regards,

    Siddarth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2009 at 10:33 PM

    .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.