cancel
Showing results for 
Search instead for 
Did you mean: 

Ignore Hard coding in S4HANA Cloud

shashankagg
Explorer
0 Kudos

Is there an option where we could ignore hard coding in custom app - CUSTOM LOGIC just like TVARVC within S4 HANA CLOUD.

Accepted Solutions (0)

Answers (2)

Answers (2)

k_vadym
Advisor
Advisor

Hi, the possible solution is to avoid hardcode in Custom Logic using custom constant interface. It`s using will be not avaiable in the app initially, so you need to release the interface at first to make it avaiable for using. Follow such steps:

  1. Create and activate a constant interface in your system.
  2. Navigate to it`s propeties and click on API State tab.k_vadym_2-1711012295324.png 
  3. Click on green '+' icon on the Use System-Internally (Contract C1) tab.

  4. Select Use in Key User Apps checkbox and click on Next until the end of a dialogue.

    k_vadym_3-1711012540641.png 
  5. That`s all, now you are able to use the interface in the Custom Logic App. 

    k_vadym_4-1711012861667.png

It will work for custom classes as well, so you also can create some kind of singletone buffer-class to store dynamic values. That`s up to your needs.

 

sergei_gook
Discoverer
0 Kudos
This is just hardcode in another place. I need something to change easily in production systems, like stvarv.
Jerry_Lowery
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Shashank

I am not sure the question is clear -could you provide some clarification?

We are assuming you have a custom logic implemented in Badi extension point via the Custom Logic app.

In that case, why do you have hard coding you want to ignore?

If you have hard coding that is optional, you should add some if/then or order logic to check for the conditions that should ignore it and then exit the badi before the hard coding executes.

OR- check for the conditions that should have the hard coding and the do the hard coding only in that case.

Thank you
Jerry

sergei_gook
Discoverer
0 Kudos
Hard code mean when for example you specified number of storage location in the code, instead if using tvarvc parameter.
sergei_gook
Discoverer
0 Kudos
For example I have BADI BADI_MMIM_CHECK_MATDOC_ITEM and can add custom logic in cloud app to block material mvt to specific storage location without reservation. I want to have parameter in tvarvc to change SL any time in prod system. As tvarvc table is not available in tvarvc I can use only hardcoding of SL number in code, that is not good.