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

Interactive MIR4

Former Member
0 Likes
3,442

hi,

i am using ALV and when i click on invoice it should go to MIR4 transaction with that invoice no.

its going to that transaction but its telling this invoice no. doesnt exists.

please help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,099

Hi Poonam Naik,

RBN is parameter id for the invoice Doc no..

Do the following in ur code.... Modify it according to structure of ur program...

FORM user_command USING ucomm TYPE sy-ucomm
                    selfield TYPE slis_selfield.
  CASE ucomm.
 
    WHEN '&IC1'.
     IF selfield-fieldname = 'BELNR'.
      SET PARAMETER ID 'RBN'  FIELD selfield-BELNR.
      CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
    ENDIF.
  ENDCASE.


ENDFORM. "user_Command

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

10 REPLIES 10
Read only

Former Member
0 Likes
2,100

Hi Poonam Naik,

RBN is parameter id for the invoice Doc no..

Do the following in ur code.... Modify it according to structure of ur program...

FORM user_command USING ucomm TYPE sy-ucomm
                    selfield TYPE slis_selfield.
  CASE ucomm.
 
    WHEN '&IC1'.
     IF selfield-fieldname = 'BELNR'.
      SET PARAMETER ID 'RBN'  FIELD selfield-BELNR.
      CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
    ENDIF.
  ENDCASE.


ENDFORM. "user_Command

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Read only

0 Likes
2,099

its telling :

The data object "RS_SELFIELD" does not have a component called INVOICE.

in ur example. its near the field SELFIELD-BELNR

Read only

0 Likes
2,099

this is the code i have tried.:

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '&IC1'.

IF rs_selfield-fieldname = 'INVOICE'.

SET PARAMETER ID 'VL' FIELD rs_selfield-value.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = it_final-invoice

IMPORTING

output = it_final-invoice.

CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDFORM. "user_command

Read only

0 Likes
2,099

Hi Poonam Naik,

See below code ==> parameter id changed from VL to RBN as parameter id for BELNR (invoice) is RBN

Check it up ...

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
  CASE R_UCOMM.
    WHEN '&IC1'.
      IF RS_SELFIELD-FIELDNAME = 'INVOICE'.
        
        SET PARAMETER ID 'RBN' FIELD RS_SELFIELD-VALUE. " parameter id changed from VL to RBN

        CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
      ENDIF.
  ENDCASE.
ENDFORM. "user_command

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Read only

0 Likes
2,099

thank you so much ilesh.

Read only

Former Member
0 Likes
2,099

Hi Friend,

Use CONVERSION_EXIT_ALPHA_INPUT for invoice no before sending to MIR4.

Hope it will solve your problem.

Regards

Krishnendu

Read only

Former Member
0 Likes
2,099

use this...

FORM user_command USING ucomm TYPE sy-ucomm

selfield TYPE slis_selfield.

CASE ucomm.

WHEN '&IC1'.

IF selfield-fieldname = 'BELNR'.

SET PARAMETER ID 'RBN' FIELD selfield-BELNR.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = S_ARSEG-BELNR

IMPORTING

OUTPUT = S_ARSEG-BELNR .

CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDFORM. "user_Command

Read only

Former Member
0 Likes
2,099

Hi,

I hope the below code will help you.

CASE command.

WHEN '&IC1'.

READ TABLE i_output INTO wa_output INDEX selfield-tabindex.

CASE selfield-fieldname.

WHEN 'MATNR'.

IF wa_output-matnr IS NOT INITIAL.

SET PARAMETER ID 'MAT' FIELD wa_output-matnr.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

ELSE.

MESSAGE s000(zm) WITH text-054.

ENDIF. " If wa_output-matnr..

WHEN 'IDNRK'.

IF wa_output-idnrk IS NOT INITIAL.

SET PARAMETER ID 'MAT' FIELD wa_output-idnrk.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

ELSE.

MESSAGE s000(zm) WITH text-054.

ENDIF. " If wa_output-idnrk IS..

WHEN 'MBLNR'.

IF wa_output-mblnr IS NOT INITIAL.

SET PARAMETER ID 'MBN' FIELD wa_output-mblnr.

SET PARAMETER ID 'MJA' FIELD wa_output-gjahr.

CALL TRANSACTION 'MB03' AND SKIP FIRST SCREEN.

ELSE.

MESSAGE s000(zm) WITH text-054.

ENDIF. " If wa_output-mblnr IS ..

WHEN 'EBELN'.

IF wa_output-ebeln IS NOT INITIAL.

SET PARAMETER ID 'BES' FIELD wa_output-ebeln.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ELSE.

MESSAGE s000(zm) WITH text-054.

ENDIF. " If wa_output-ebeln IS ..

ENDCASE.

ENDCASE.

Thanks,

Khushbu.

Read only

Former Member
0 Likes
2,099

Change SELFIELD-VALUE instead of SELFIELD-BELNR.

Also use CONVERSION_EXIT_ALPHA_INPUT if needed...

As sometime due to type mismatch it won't give proper output...

Check the content of SELFIELD-VALUE in debugging mode...

if it's not as the Data type and lenght of BELNR then use the FM CONVERSION_EXIT_ALPHA_INPUT

FORM USER_COMMAND USING UCOMM TYPE SY-UCOMM
                    SELFIELD TYPE SLIS_SELFIELD.
  CASE UCOMM.

    WHEN '&IC1'.
      IF SELFIELD-FIELDNAME = 'BELNR'.
        SET PARAMETER ID 'RBN'  FIELD SELFIELD-VALUE. " I have Changed this line
        CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
      ENDIF.
  ENDCASE.


ENDFORM. "user_Command

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Read only

0 Likes
2,099

its not entering the loop.