Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get field when opening a matchcode inside of a matchcode

Former Member
0 Likes
1,185

Hello,

I have a problem with matchcodes.

When I define a matchcode in the dictionary transaction I can define the fields and associate a value whit the import property. But I would like to export the value of one field when I execute another matchcode inside of the mathcode of one of the fields.

For example, in invoices I can see the field customers, but if I get a second matchcode of them I want to see only the customers for the BUKRS of that invoice.

Thanks for your help.

Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
908

Hi,

For the first parameter, you can use matchcode,

For the second parameter, you should use a FM to satisfy your requirement.

code for your reference.

DATA: begin of wa,
      matnr type matnr,
      end of wa,
      itab like standard table of wa.

parameters: p_matnr type matnr,
            p_second(18) type c .

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SECOND.
wa-matnr = p_matnr.
append wa to itab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
*   DDIC_STRUCTURE         = ' '
    retfield               = 'MATNR'              " reference field in the table
*   PVALKEY                = ' '
   DYNPPROG               = 'ZC_TEST '        " report name
   DYNPNR                 = '100'                    "screen number
   DYNPROFIELD            = 'P_SECOND '   " second parameter name 
*   STEPL                  = 0
*   WINDOW_TITLE           =
*   VALUE                  = ' '
   VALUE_ORG              = 'S'
*   MULTIPLE_CHOICE        = ' '
*   DISPLAY                = ' '
*   CALLBACK_PROGRAM       = ' '
*   CALLBACK_FORM          = ' '
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
  tables
    value_tab              = itab                    " contain data what you want
*   FIELD_TAB              =
*   RETURN_TAB             =
*   DYNPFLD_MAPPING        =
* 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.

Hello,

I have a problem with matchcodes.

When I define a matchcode in the dictionary transaction I can define the fields and associate a value whit the import property. But I would like to export the value of one field when I execute another matchcode inside of the mathcode of one of the fields.

For example, in invoices I can see the field customers, but if I get a second matchcode of them I want to see only the customers for the BUKRS of that invoice.

Thanks for your help.

Regards.

5 REPLIES 5
Read only

Former Member
0 Likes
908

Hi,

Do you mean you have two parameters in the screen and then when you get value from the first parameter, the second parameter's search help should display according to the value you get from the first one ?

If so, I can give you some hints.

Regards,

Chris Gu

Read only

0 Likes
908

Yes, I think I want what you say.

In short. Imagine there are 2 input fields in the u201CMathcode Au201D. Field_1 gets a valor from screen, and field_2 is blank. Then I want to display the field_2 matchcode, "Matchcode B", and get value from field_1 because it is used too as input field in u201CMatchcode Bu201D.

Thanks a lot for your hists.

Regards.

Read only

0 Likes
908

Hello Luis,

you can also use Fm DYNP_VALUES_READ to get the accepted F4 help value in the First field without triggering PAI and can use in the select query to get the values for the secon field (may be useful in a select query)

You can take the help of FIELD_MAPPING parameter of FM F4IF_INT_TABLE_VALUE_REQUEST

Or you can use the FM DYNP_VALUES_UPDATE

Best Regards

Ramchander Rao.K

Edited by: ramchander krishnamraju on Dec 11, 2008 11:33 AM

Read only

Former Member
0 Likes
909

Hi,

For the first parameter, you can use matchcode,

For the second parameter, you should use a FM to satisfy your requirement.

code for your reference.

DATA: begin of wa,
      matnr type matnr,
      end of wa,
      itab like standard table of wa.

parameters: p_matnr type matnr,
            p_second(18) type c .

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SECOND.
wa-matnr = p_matnr.
append wa to itab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
*   DDIC_STRUCTURE         = ' '
    retfield               = 'MATNR'              " reference field in the table
*   PVALKEY                = ' '
   DYNPPROG               = 'ZC_TEST '        " report name
   DYNPNR                 = '100'                    "screen number
   DYNPROFIELD            = 'P_SECOND '   " second parameter name 
*   STEPL                  = 0
*   WINDOW_TITLE           =
*   VALUE                  = ' '
   VALUE_ORG              = 'S'
*   MULTIPLE_CHOICE        = ' '
*   DISPLAY                = ' '
*   CALLBACK_PROGRAM       = ' '
*   CALLBACK_FORM          = ' '
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
  tables
    value_tab              = itab                    " contain data what you want
*   FIELD_TAB              =
*   RETURN_TAB             =
*   DYNPFLD_MAPPING        =
* 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.

Read only

Former Member
0 Likes
908

Thankyou very much for your help.