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

Module pool question

Hi,

I have a module pool program, in that the initial screen contains 'Display Contents', when I click that the Custom table contents will be displayed

with a check box in the front for each record. In that screen I added the button 'Creat Credit Memo' on application tool bar in pf-status 'List'. Where should I write the code to create Credit Memo.

I have to create credit memo request for only checked records.

Please help me.

Thanks,

Neelu.

PROCESS BEFORE OUTPUT.
 MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
 MODULE USER_COMMAND_0100.
--------------

MODULE USER_COMMAND_0100 INPUT.
  CASE OK_CODE.
    WHEN 'DISP'.
      CLEAR OK_CODE.
      CALL SCREEN 200.
----------------

PROCESS BEFORE OUTPUT.
* MODULE STATUS_0200.
MODULE PREPARE_LIST.
PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0200.
--------------------------------

MODULE PREPARE_LIST OUTPUT.
  LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 100.
  PERFORM EDIT_LIST.
  LEAVE SCREEN.
ENDMODULE.                 " PREPARE_LIST  OUTPUT
------------------------------------

FORM EDIT_LIST.
 Data: chbox(1) type c value ' '.

  SET PF-STATUS 'LIST'.
  NEW-PAGE LINE-SIZE 158.
  SELECT * FROM ZPPPRICE.
    SELECT SINGLE NAME1 FROM KNA1 INTO KNA1-NAME1
                   WHERE KUNNR = ZPPPRICE-KUNNR.
    WRITE: /01 SY-VLINE,
            02 chbox as checkbox,
            04 SY-VLINE,
            05 ZPPPRICE-KUNNR,
            16 SY-VLINE,
            17 KNA1-NAME1,
            43 SY-VLINE,
            44 ZPPPRICE-MATNR,
            63 SY-VLINE,
            64 ZPPPRICE-CRDATE,
            75 SY-VLINE,
            76 ZPPPRICE-EFDATE,
            87 SY-VLINE,
            88 ZPPPRICE-SPRICE,
            104 SY-VLINE,
            105 ZPPPRICE-EPRICE,
            122 SY-VLINE,
            123 ZPPPRICE-EOHQTY,
            134 SY-VLINE,
            135 ZPPPRICE-AOHQTY,
            146 SY-VLINE,
            147 ZPPPRICE-CRMEMO,
            158 SY-VLINE.
  ENDSELECT.
  CLEAR ZPPPRICE.
  WRITE: /01(158) SY-ULINE.
ENDFORM.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 01:39 PM

    Hello Neelu,

    In my opinion this is not a nice design. You can achive the same result using

    1. A simple interactive report.

    Where you will read the list outout using

    DO.

    READ LINE INTN SY-LISEL INDEX SY-INDEX.

    IF NOT SY-SUBRC IS INITIAL.

    EXIT

    ELSE.

    IF SY-LISEL+OFFSET(1) EQ 'X'. " Your check box position on the screen.

    *Check box is ticked.

    ENDIF.

    ENDIF.

    2. ALV grid where selected row will taken care by the standard ALV functionality.

    at use-commnand event of ALV grid insert your own code.

    3. Module pool, instead of displaying the list, use a table control with multiple row selection. and module use-command insert the code to create the credit memo.

    Please refer any SAP standard help program starting with DEMOtable

    In you design you are mixing a list processing & module pool making it complex.

    Regards,

    A.Singh

    Message was edited by:

    Amarjit Singh

    Message was edited by:

    Amarjit Singh

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      In your code:

      WRITE CKBOX AS CHECKBOX INPUT ON. "To make input enable

      Please follow the demo report: DEMO_DYNPROS_AND_LISTS

      I hope you are providing the button 'Create Credit memo' on the list output.

      In your list report at the AT USER-COMMAND event.

      You insert the code.

      1. First select all the ticked records.

      DO.

      READ LINE INTO SY-LISEL INDEX SY-INDEX

      IF NOT sy-subrc IS INITIAL.

      EXIT.

      ELSE.

      IF SY-LISEL+OFFSET(1) EQ 'X'.

      CLEAR ITAB.

      ITAB-<FLD01> = SY-LISEL+OFFSET1(LEN1).

      ITAB-<FLD02> = SY-LISEL+OFFSET2(LEN2).

      ......................................................................

      ......................................................................

      APPEND ITAB.

      ENDIF.

      ENDIF.

      ENDDO.

      2. Selected records loop to create the credit memo.

      *----


      LOOP AT ITAB.

      *<Your BDC/BAPI/FM etc to create creadit Memo>

      ENDLOOP.

      Regards,

      A.Singh

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 01:24 PM

    HI,

    write the code in th PAI of the screen to which u kept the PF_STATUS.

    i.e, in MODULE USER_COMMAND_0200.

    rgds,

    bharat.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 01:25 PM

    hi neelu,

    u should write code in pbo module of flow logic [ if u want to perform any validations for those records].

    create a sub routine in flow logic of pbo module as

    PROCESS BEFORE OUTPUT.

    • MODULE STATUS_0200.

    MODULE PREPARE_LIST.

    Module checkorder. -> double click n write code for that module.

    PROCESS AFTER INPUT.

    if helpful reward some points.

    with regards,

    Suresh.A

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 11, 2007 at 01:26 PM

    In USER_COMMAND_0200 loop over all checked records and create credit memo for each.

    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.