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: 

how to find (SAPLMRMF)TAB_ERRPROT[] in badi

Former Member
0 Kudos

i need to implement badi MRM_HEADER_CHECK.

in scn i seen in that badi implementation this type used

(SAPLMRMF)TAB_ERRPROT[]  for error how we can identify this structure.

5 REPLIES 5

Private_Member_7726
Active Contributor
0 Kudos

Hi,

It's defined in line 23 of include LMRMFTOP on my system. However... why do you need to use this atrocious and SAP internal (see under third note) way of directly referring to the global data in another program (moreover, if you don't seem to know, what that kind of coding even means)? This function group seems to have nice API to access TAB_ERRPROT - GET, FILL Function and so forth...

Edit in: I shouldn't have formulated the answer this way, sorry In case it was not clear from the link, the name in the parentheses is the ABAP program in which TAB_ERRPROT[] is defined. You'd improve maintainability of the BADI implementation, if you could rewrite the access to TAB_ERRPROT using Function modules from Function Group MRMF. If you have a link to the code on SCN or if it's not too big to post it here, I could try to understand if and how it can be done.


cheers

Janis

Message was edited by: Jānis B

Former Member
0 Kudos

as previously explained, if possible, do not use the syntax with the (program)variable/perform etc. It is mainly used for internal purposes (and even there SAP is to be blamed for using such syntax). Once you are using an exit, try implementing it so that you have all the values needed in you method and do not access them via those dynamic-assigning-of-not-owned variables in the same session. It is

1. dangerous

2. once developers started to dislike go-to statements existing since first high-level programming languages, they will dislike this situation even more. Explain your situtation a little more to get the best stolution

0 Kudos

Dear Experts thank you...

Still i am not getting answer...pl. explain in step by step procedure.

0 Kudos

Do not use that syntax as explained. Try e.g. FM MRM_PROT_FILL to fill the protocol with the messages. If you need to read the protocol, generated so far, use MRM_PROT_GET.

So when your check finds an error, call

CALL FUNCTION MRM_PROT_FILL

     TABLES  T_ERRPROT = LT_ERROR.

Where your lt_error internal table contains error messages you want to show to the user.

former_member195402
Active Contributor
0 Kudos

Hi Ganesh,

(SAPLMRMF)TAB_ERRPROT[] means table TAB_ERRPROT in program SAPLMRMF. It can be found in include LMRMFTOP as Jānis B wrote before.

To access (SAPLMRMF)TAB_ERRPROT[] you can do the following in your BADI:

TYPE-POOLS:    mrm.

DATA:          ls_errprot TYPE mrm_errprot.

FIELD-SYMBOLS: <ERRPROT>  TYPE TABLE OF mrm_errprot.

ASSIGN ('(SAPLMRMF)TAB_ERRPROT[]') TO <ERRPROT>.

You can use ls_errprot for LOOP or INSERT or APPEND.

Regards,

Klaus