Application Development 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: 

mb_migo_badi : disable input of the custom field on change of action

former_member220286
Participant
0 Kudos

please suggest how to disable zinput : custom filed added in MIGO header tab .

I want to disable on changing the action .

i_action:

A01 = Goods receipt

A02 = Return delivery

A03 = Cancellation

A04 = Display

A05 = Release GR bl.st.

A06 = Subsequent deliv.

A07 = Goods issue

When i run the TCODE : MIGO

I want that the zinput custom field should be displayed in output only mode when I select the action as A4 that is display .

1 ACCEPTED SOLUTION

former_member220286
Participant
0 Kudos

Please suggest some more ideas .

15 REPLIES 15

former_member210541
Active Participant
0 Kudos

in the pbo of your screen

if-goheader-action = 'A04'

loop on screen

if screen-name = 'Z FIELD'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

Former Member
0 Kudos

Hi,

I assume you have written set_data get_data sort of module to communicate with the MIGO screen values,

Now here you can paas the value of the Action in your get data module and in the screen PBO you can read that value and set the screen-input = 0.

hope this help.

former_member220286
Participant
0 Kudos

Please suggest some more ideas .

0 Kudos

Ok,

In the BADI MB_MIGO_BADI  method if_ex_mb_migo_badi~pbo_header.  you have a code as below.

check i_class_id = gf_class_id.

check sy-tcode = 'MIGO'.  

e_cprog   = 'SAPLZFG_MIGO_HEADER'.  

e_dynnr   = '9100'.                     "External fields: Input  

e_heading = 'Additional Tab'.  

call function 'ZFM_SET_DATA'     

exporting         g_no_input = g_no_input.

endmethod.

Here set the G_NO_INPUT as 'X' in the method MODE_SET based on you actions.

method if_ex_mb_migo_badi~mode_set.

* ACTION and REFDOC will discribe the mode of transaction MIGO.

* ----------------------------------------------------------------------

* In case of 'DISPLAY' the global field G_NO_INPUT will be set to 'X'.

* The result is that a different external subscreen will be choosen in

* method PBO_DETAIL.

* In case of 'CANCEL' the global field G_CANCEL will be set to 'X'.

* The result is that in method POST_DOCUMENT a different handling is

* used   

clear: g_no_input,g_cancel. 

if i_action = 'A04' or i_action = 'A03'.     

g_no_input = 'X'.   

endif.

Endmethod.

Now in the Function group ZFG_MIGO_HEADER and FM SET_DATA you will get G_NO_INPUT as 'X'.

so in the screen 9100 PBO.

if g_no_input eq 'X'.

loop at screen.

screen-input = 0.

modify screen.

endloop.

Note : all the variables, program names, screen no and FM name are just for example, you can create as you like or your org naming convention.

Hope this helps.

0 Kudos

HI Gaurav ,

Thanks for your valuable reply .

I am using this module to disable input in PBO of the custom screen created .

MODULE DISABLE_INPUT OUTPUT.

 

   IF G_NO_INPUT EQ 'X'.

     LOOP AT SCREEN .

         SCREEN-INPUT = 0.

       MODIFY SCREEN.

      ENDLOOP .

   ENDIF.

ENDMODULE.   

In method mode set I am using below code .But still my input is not getting disabled when I select A04 that is display .

method IF_EX_MB_MIGO_BADI~MODE_SET.

* In case of 'DISPLAY' the global field G_NO_INPUT will be set to 'X'.

* The result is that a different external subscreen will be choosen in

DATA : G_ACTION TYPE GOACTION.                 

CLEAR : G_NO_INPUT , G_CANCEL .               

* method PBO_DETAIL.

  IF i_action = 'A04' OR i_action = 'A03' OR i_action = 'A05'.

      g_no_input    = 'X'.

  ENDIF.

* In case of 'CANCEL' the global field G_CANCEL will be set to 'X'.

* The result is that in method POST_DOCUMENT a different handling is

* used

  IF i_action = 'A03'.

    g_cancel = 'X'.

  ENDIF.

IF I_ACTION = 'A03'   AND I_REFDOC = 'R02'.          

    G_CHK = 'X'.

ENDIF.

***Chk in MIGO for Outbound

  IF i_action = 'A01' AND i_refdoc = 'R05'.

    g_chk = 'X'.

  ENDIF.

endmethod.

Please suggest how the value g_no_input = 'X' on choosing action as A4 will go from the zimplementation mode_set to the screen .. or when we run Migo and choose action A4 it will disable the zinput . 

0 Kudos

Now this is all screen flow.

When you run the T-code MIGO method Mode_set will be called and the g_no_input will be set.

Whenever you change the action this method will be called.

Once the mode_set is called an g_no_input is set to 'X', when you click on your custom tab, the PBO_header method will be called where youa ssign the program name and screen no . Right??.

in this PBO method you pass the g_no_input value to the screen using FM SET_DATA.

This calling of FM SET_DATA is important as it will allow you to pass data to and fro the migo screen and your badi.

Now about your screen designing part, it should be in a Function Group and the set_data FM should also be in this FM.

Define g_no_input as a global variable in the Function group's main Program.

Now in the PBO of the screen the value of g_n_input will be available.

Hope this helps.

0 Kudos

Thanks a ton Gaurav for all your valuable ideas .Finally I resolved this issue .

I did this by using the export and import parameters .

EXPORT G_NO_INPUT FROM G_NO_INPUT TO MEMORY ID 'INPT1245.

IF i_action = 'A04' .

       g_no_input    = 'X'.

ENDIF.

and then importing the values in the PBO section of the custom screen created in the function group .

IMPORT  G_NO_INPUT TO G_NO_INPUT FROM  MEMORY ID 'INPT1245'.

then using the screen input disable code lines :-

IF G_NO_INPUT EQ 'X'.

     LOOP AT SCREEN .

         SCREEN-INPUT = 0.

       MODIFY SCREEN.

      ENDLOOP .

   ENDIF.

0 Kudos

Hi Gaurav ,

I also want the movement no : BWART  to be updated in my ztable .

Please suggest which standard structure/table to hit for this so that I can bring that number in my ztable .So that it can be updated in my ztable .

Regards

Deepak

0 Kudos

Hi,

In the method POST_DOCUMENT you can check the structure IT_MSEG for bwart.

hope this helps.

0 Kudos

Hi Gaurav ,

My stucture : IS_MKPF is holding these fields only : -

There is no field named BWART in this structure  shown below .

MANDT
MBLNR
MJAHR
VGART
BLART
BLAUM
BLDAT
BUDAT
CPUDT
CPUTM
AEDAT
USNAM
TCODE
XBLNR
BKTXT
FRATH
FRBNR
WEVER
XABLN
AWSYS
BLA2D
TCODE2
BFWMS
EXNUM
SPE_BUDAT_UHR
SPE_BUDAT_ZONE
LE_VBELN
SPE_LOGSYS
SPE_MDNUM_EWM
GTS_CUSREF_NO
FLS_RSTO
MSR_ACTIVE

0 Kudos

Dear Gaurav ,

In the method : IF_EX_MB_MIGO_BADI~POST_DOCUMENT

If at the runtime I manually update the field value : GS_EXDATA_HEADER  as 101 or 103 , etc .Then it is getting updated in the ztable .

But normally if i run the GS_EXDATA_HEADER is not updated with the movement : bwart value . bcoz bwart is not there in the structure : IS_MKPF .

*The data from external header screen can be saved now:-

     MOVE-CORRESPONDING IS_MKPF TO GS_EXDATA_HEADER.

     CALL FUNCTION 'ZMIGO_BADI_EXAMPLE_UPDATE_HEAD' IN UPDATE TASK   "MIGO_BADI_EXAMPLE_UPDATE_HEAD

       EXPORTING

         IS_MIGO_BADI_HEADER_FIELDS = GS_EXDATA_HEADER. "is_migo_badi_header_fields

  ENDLOOP.

Please suggest  .

0 Kudos

Sorry for the wrong structure, I had updated my comment. try with IT_MSEG. it has the field BWART.

Hope this helps.

0 Kudos

Hi Gaurav ,

What I did is that since I amp getting the BWART value udated in the table :

IT_MSEG .

LOOP AT  IT_MSEG INTO WA_MSEG where bwart = '101' .

GS_EXDATA_HEADER-BWART = WA_MSEG-BWART.    

So this way i updated my ztable .

0 Kudos

Happy to help.

0 Kudos

Hi Gaurav,

Can you please check ?

If possible any suggestions ?

Best Regards,

Kiran