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

parameters option

Hello All,

I have two parameters input field on the selection screen first one is company code and other is cash journal no.

we are having multiple company codes in our organisation, now the requirement is when the user selects a company code

(say 1000 )the cash journal no parameter field should display tht list whcih are avaialable in company code 1000.

Pls let me knw how this is possible in zreports.

Thnks

sunny

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 01, 2008 at 09:56 AM

    Hi,

    Use the below logic.

    tables: t001k.

    • For Identification Number

    DATA: BEGIN OF it_bwkey OCCURS 0,

    bwkey LIKE t001k-bwkey,

    END OF it_bwkey.

    data: v_bukrs(4).

    • For Run date

    DATA: BEGIN OF it_bukrs OCCURS 0,

    bukrs LIKE t001k-bukrs,

    END OF it_bukrs.

    DATA it_ret LIKE ddshretval OCCURS 0 WITH HEADER LINE.

    SELECTION-SCREEN: BEGIN OF BLOCK main WITH FRAME TITLE text-001.

    SELECTION-SCREEN SKIP.

    PARAMETERS: p_bukrs(4) TYPE c.

    SELECT-OPTIONS s_bwkey FOR t001k-bwkey NO INTERVALS.

    SELECTION-SCREEN END OF BLOCK main.

    *----


    • Validation Section

    *----


    INITIALIZATION.

    SELECT DISTINCT bukrs FROM t001k INTO TABLE it_bukrs.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    retfield = 'BUKRS'

    dynpprog = sy-repid

    dynpnr = sy-dynnr

    dynprofield = 'P_BUKRS'

    value_org = 'S'

    TABLES

    value_tab = it_bukrs

    EXCEPTIONS

    parameter_error = 1

    no_values_found = 2

    OTHERS = 3.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_bwkey-low.

    TABLES: t130r.

    DATA: BEGIN OF dynpfields OCCURS 0. "Hilfsstruktur zum auslesen des

    INCLUDE STRUCTURE dynpread. "Feldwertes vom Dynpro bei >F4<

    DATA: END OF dynpfields.

    DATA : sy_repid LIKE sy-repid,

    sy_dynnr LIKE sy-dynnr.

    CLEAR dynpfields.

    REFRESH dynpfields.

    dynpfields-fieldname = 'P_BUKRS'.

    APPEND dynpfields.

      • Lesen des akt. Wertes von Dynpro

      sy_repid = sy-repid.

      sy_dynnr = sy-dynnr.

      CALL FUNCTION 'DYNP_VALUES_READ'

      EXPORTING

      dyname = sy_repid

      dynumb = sy_dynnr

      TABLES

      dynpfields = dynpfields

      EXCEPTIONS

      OTHERS = 01.

      IF sy-subrc = 0.

      READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.

      IF sy-subrc = 0.

      v_bukrs = dynpfields-fieldvalue.

      ENDIF.

      ENDIF.

      SELECT bwkey FROM t001k

      INTO TABLE it_bwkey

      WHERE bukrs = v_bukrs.

      DELETE ADJACENT DUPLICATES FROM it_bwkey.

      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

      EXPORTING

      retfield = 'BWKEY'

      dynpprog = sy-repid

      dynpnr = sy-dynnr

      dynprofield = 'S_BWKEY'

      value_org = 'S'

      TABLES

      value_tab = it_bwkey

      EXCEPTIONS

      parameter_error = 1

      no_values_found = 2

      OTHERS = 3.

      IF sy-subrc <> 0.

      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

      ENDIF.

      Add a comment
      10|10000 characters needed characters exceeded

    • author's profile photo Former Member
      Former Member
      Posted on May 01, 2008 at 10:03 AM

      Hi,

      Follow the Below Steps:

      1. Create the Company Code Parameter with USER-COMMAND ucom addition.

      2. AT SELECTION-SCREEN ON p_company_code.

      create an Internal Table with one Field i.e. Cash Journal Number.

      3. then Write a SELECT statement:

      SELECT journal_no

      FROM ZTABLE

      INTO TABLE itab

      WHERE company_code EQ p_company_code.

      4. CALL FM F4IF_INT_TABLE_VALUE_REQUEST and set the Input Help for Journal Number with Input as the Internal Table itab.

      Regards,

      Sunil.

      Add a comment
      10|10000 characters needed characters exceeded

    • author's profile photo Former Member
      Former Member
      Posted on May 01, 2008 at 10:09 AM

      Hi sunny vaswani

      U can do this.. U can get the comapny code entered by using

      the below function module. There by u can use the return company code to fetch journal numbers.

      Please this at

      At selection-screen on value-request for p_journalno.

      CALL FUNCTION 'DYNP_VALUES_READ'

      EXPORTING

      dyname = sy-cprog

      dynumb = sy-dynnr

      TABLES

      dynpfields = dynp_fields

      EXCEPTIONS

      invalid_abapworkarea = 1

      invalid_dynprofield = 2

      invalid_dynproname = 3

      invalid_dynpronummer = 4

      invalid_request = 5

      no_fielddescription = 6

      invalid_parameter = 7

      undefind_error = 8

      OTHERS = 9.

      READ TABLE dynp_fields WITH KEY fieldname = 'P_COMPANYCODE'.

      IF dynp_fields-fieldvalue IS INITIAL.

      EXIT.

      ELSE.

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

      EXPORTING

      input = dynp_fields-fieldvalue

      IMPORTING

      output = g_phynr.

      ENDIF.

      Use the above field and provide f4 help for journal number.s

      Venkat.

      Add a comment
      10|10000 characters needed characters exceeded

    • author's profile photo Former Member
      Former Member
      Posted on May 02, 2008 at 10:48 AM

      thnks

      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.