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

match code

Former Member
0 Likes
719

Hi experts,

I have a task. In <b>cor3</b> tcode when we press f4 at the purchase order field in te search help we have different tabs. In that window I need to add one more tab and enable the user to select the <b>purchse order by the batch numbers</b>.

Batch numbers are present in the table <b>AFPOD</b> and the field is <b>CHARG.</b> I dont know how to add this tab. Plz help me in this regard,

thanks

4 REPLIES 4
Read only

rodrigo_paisante3
Active Contributor
0 Likes
681

Hi,

just you want to do is populate your own table (you define the fields) and call function module F4IF_INT_TABLE_VALUE_REQUEST for F4 values. You need to put your code in the AT SELECTION-SCREEN block.

A sample:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cnpj.

REFRESH: ti_cnpj, ti_fieldtab, ti_returnval.

SELECT cgc_branch name

FROM j_1bbranch

INTO TABLE ti_cnpj

WHERE bukrs = 'CNBR'.

CLEAR ti_fieldtab.

ti_fieldtab-tabname = 'TI_CNPJ'.

ti_fieldtab-fieldname = 'CGC_BRANCH'.

ti_fieldtab-position = '1'.

ti_fieldtab-outputlen = '4'.

ti_fieldtab-inttype = 'C'.

ti_fieldtab-intlen = '4'.

ti_fieldtab-rollname = 'Cod CNPJ'.

ti_fieldtab-scrtext_s = 'Cód CNPJ'.

ti_fieldtab-scrtext_m = 'Cód CNPJ'.

ti_fieldtab-scrtext_l = 'Cód CNPJ'.

APPEND ti_fieldtab.

CLEAR ti_fieldtab.

ti_fieldtab-inttype = 'C'.

ti_fieldtab-tabname = 'TI_CNPJ'.

ti_fieldtab-position = '2'.

ti_fieldtab-offset = '4'.

ti_fieldtab-outputlen = '30'.

ti_fieldtab-intlen = '30'.

ti_fieldtab-rollname = 'NOME'.

ti_fieldtab-fieldname = 'NOME'.

ti_fieldtab-scrtext_s = 'Nome'.

ti_fieldtab-scrtext_m = 'Nome'.

ti_fieldtab-scrtext_l = 'Nome'.

APPEND ti_fieldtab.

  • Call the function module F4IF_INT_TABLE_VALUE_REQUEST for F4 values

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'CGC_BRANCH'

window_title = 'Cód CNPJ'

value_org = 'S'

multiple_choice = ' ' " (for muliple selection)

TABLES

value_tab = ti_cnpj

field_tab = ti_fieldtab

return_tab = ti_returnval

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.

ELSE.

  • Star for For single values

READ TABLE ti_returnval INDEX 1.

p_cnpj = ti_returnval-fieldval.

  • End for the single values

ENDIF.

Reward if useful

Regards

Read only

0 Likes
681

Hi RP,

But the transaction is a sap std transaction. So I cant modify the code as such.Plz tell me if there is any other way.

thanks.

Read only

0 Likes
681

Oh, its true, sorry.

I dont know if it is possible to create this.

Regards

Read only

Former Member
0 Likes
681

Hi RP,

I was able to fine the solution. Just created a database view and then I created a search help with this view. Then added this elementary search help to the std collective help. Thanks anyway for the quick responese