SAP & Oracle partner and support companies

Loading

Archives June 2025

SAP

Easy Trick to Disable Hold Button in PO (ME21N) using BADI

I want to share a simple trick to make use of a BAdI and disable Hold button in Purchase Order Creation (t-code ME21N). Let’s go deep into the Easy Trick to Disable Hold Button in PO ME21N using BADI.

  • On initial step, ensure Keep button actually exists. Check the Hold featured in yellow.
  • Open BAdI Developer through T-Code SE19. On BAdI Developer screen, pick Exemplary BAdI, on BAdI name segment fill ME_HOLD_PO and afterward click on Make Impl. button. In this step, we duplicate default standard BAdI which is ME_HOLD_PO into our BAdI name.
  • Input execution name as our BAdI name, remember to begin your BAdI Execution name with Z or Y, for instance I utilized ZHOLDPO name for my BAdI name.
  • Input some text for the BAdI Execution depiction.
  • Remember your BAdI Execution for a bundle and dole out into a vehicle demand to ship it to Quality and consequently to Creation framework.
  • Click on Point of interaction Tab, and afterward Double tap on Technique IS_ALLOWED.
  • It opens the ABAP Supervisor. To see existing boundary, simply click signature button.
  • We can see boundary CH_ALLOWED. We want to utilize this boundary to cripple Hold Button in the PO. Put your code among strategy and endmethod. We have hard-coded CH_ALLOWED with invalid worth. It implies Hold button won’t exist any longer. Remember to Enact your BAdI Execution.
  • Simply press enter on spring up, this spring up seems on the grounds that there is one more article with inert status.
  • Simply ensure your code is enacted. Click back on back button.
  • In any case, BAdI status is as yet latent, and Runtime Conduct is “Execution won’t be called”. You can definitely relax, it implies BAdI was not executed as expected. We simply have to Enact the BAdI Execution here.
  • After enactment of BAdI Execution, status will be Dynamic and Runtime Conduct will be “Execution will be called”.
  • Last step. How about we approve our adjustment of the PO screen. Bingo!! The Hold button which you found in the absolute first screen capture, doesn’t exist. Presently, go an illuminate the business group who requested it. Your task is finished for the afternoon.

This is a basic arrangement once you track down it. In any case, when you don’t have a clue about the BAdI name, you need to scramble around and google. Easy Trick to Disable Hold Button in PO ME21N using BADI.

YOU MAY LIKE THIS

How to check your custom ABAP code for SAP BTP ABAP Environment

10 Real-World SAP ABAP Programming Examples (with Code!)

Number Range tcode in SAP

Create and Consume Business Add-in(BAdI) in ABAP

SAP

Quick Guide: SAP Debugger New Tool for Memory Stack

The SAP Debugger New Tool for Memory Stack is a powerful new feature that makes debugging in SAP ABAP more efficient and developer-friendly. Whether you’re trying to retrieve hidden field values from a transaction or access global variables during runtime, this tool gives you a clear path through the memory stack. In this quick guide, you’ll learn how to use the SAP Debugger’s new memory stack tool in just 5 steps — perfect for solving those tricky BADI and client exit challenges.

In this article, Fetching Data from Memory Stack Using New Tool (in Debugger), we will gain proficiency with a short and straightforward stunt to get to separate qualities standard exchange code.

Essentially, we would take advantage of the Memory Stack at Run-Time involving the New Apparatus in Debugger. Assuming in any meeting somebody asks you, do you realize Memory Stack Programming? Subsequent to going through this article, your response ought to be a major certain certifiable.

Following are the steps that need to be followed:

Get the program name and field information from the screen (utilizing F1)

Add a breakpoint in the exit/BADI

Execute the exchange and actually look at the worth at runtime utilizing New Apparatus (Devices – > Exceptional Instrument -> Stacked Projects)

Add code in the exit/BADI for getting information from the screen field

Stranger than fiction can be the truth. I’ll give you a very simple constant-use model. In SAP, there is a mechanism to include one-time seller details when submitting a purchase request. The length of the approval PINCODE must be included.

We were involving Actually look at strategy for BADI ME_PROCESS_PO_CUST for approval in PO. Yet, found that the location subtleties were not open in the BADI.

We followed the 4 stages referenced previously. We found the program name and field information.

This image has an empty alt attribute; its file name is image001.png

Added the debugger and executed the exchange. In the debugger apparatus, go to New Device choice.

new tool in debugger

Alert: In the event that your debugger takes you to the Standard Tab naturally, you wouldn’t view as the “New Apparatus”. Try not to overreact. Simply click Work area 1 or Work area 2 or Work area 3 and New Device would show up for your administration.

This image has an empty alt attribute; its file name is newtool.jpg

Go to Stacked Projects choice in Extraordinary Devices.

Loaded Program

Select Worldwide Information tab where we will actually want to see every one of the worldwide factors of each program.

New Tool in SAP

Allow us now to track down the program and field for Address information.

This image has an empty alt attribute; its file name is image007.png

Definitely, we got the ADDR1_DATA values. So presently we arrived at the last step – the code :).

  FIELD-SYMBOLS:<fs1> TYPE any.

* Make the system know from which Program we need the data
  DATA:post_code(40) TYPE c VALUE '(SAPLSZA1)ADDR1_DATA-POST_CODE1'.

* Assign the value to a field system
  ASSIGN (post_code) TO <fs1>.

  IF  <fs1> IS ASSIGNED.
* Do your validation
    IF strlen( <fs1> ) NE '6'.
          MESSAGE 'Postal Code should be of length 6.' TYPE 'E'.
    ENDIF.

  ENDIF.

Fundamentally, we just dove profoundly into the memory stack at the run-time and searched for all projects that were stacked in the framework for consummation of the specific exchange. Utilizing the New Instrument, we tracked down the Worldwide Information. When you have the Worldwide Information, you can simply get that information in your program utilizing Field Image.

Trust you like this stunt. This is a basic arrangement which we want to do in each venture. On the off chance that you are a novice on SAP ABAP, bookmark this article. You would require this for your most memorable Memory Stack Programming.

You can execute this equivalent stunt to get any worldwide information like table, structures, factors, objects and so forth.

Note: There is a restriction. On the off chance that the variable, workspace, table and so forth are NOT announced as Worldwide on the stacked projects, then, at that point, we Can’t recover its worth utilizing the above technique.

YOU MAY BE INTERESTED IN

Future of ABAP on Cloud

ABAP Development Environment in the Cloud

ALE and IDoc in SAP ABAP: A Deep Dive

× How can I help you?