<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic read memory doesn't work with badi ?? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659410#M1096260</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a sollution in an user exit for goods movement to read the memory of the screen since I had to check the changed data before saving.&lt;/P&gt;&lt;P&gt;it works perfectly so now I thought I could also use it in a badi but somehow it doesn't work and it can't read the programm memory .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this was my code from the user exit of IW42&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: global_field_name(100).
data: artikel type structure occurs 0 with header line .

DATA: BEGIN OF gt_comp OCCURS 0.
        INCLUDE STRUCTURE cowb_comp.
DATA: END OF gt_comp.

field-symbols : &amp;lt;fs&amp;gt; type any table,
                &amp;lt;wa&amp;gt; type any.



clear global_field_name.
move '(SAPLCOWB)GT_COMP[]'  to global_field_name.
assign (global_field_name) to &amp;lt;fs&amp;gt;.


* functie moet alleen werken indien het element alwaar terugmelding op gemaakt wordt een serviceorder is
* en via totale terugmelding IW42 wordt ingevoerd
if caufvd_tab-aufnr is not initial and sy-tcode EQ 'IW42'.

loop at &amp;lt;fs&amp;gt; assigning &amp;lt;wa&amp;gt;.
move &amp;lt;wa&amp;gt; to gt_comp.
if gt_comp-rsnum eq '0'.
    message ID 'ZCS' type 'E' number '001'.
endif.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which works fantastic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I tried to translate it to the badi and it doesn't work at all. the error &amp;lt;fs&amp;gt; is not assigned is raised. somehow the trick is differently in a badi or in a method to read something from memory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the purpose is that I only need to perform the check when the status is set to AFSL&lt;/P&gt;&lt;P&gt;so I try to read the structure CNJ_STAT from memory which is the programm SAPLCJWB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: h_error type string.

data: global_field_name(100).
data: gt_cnj_stat type table of cnj_stat.

field-symbols : &amp;lt;fs&amp;gt; type any table,
                &amp;lt;wa&amp;gt; type any.



clear global_field_name.
move '(SAPLCJWB)gt_CNJ_STAT[]'  to global_field_name.
assign (global_field_name) to &amp;lt;fs&amp;gt;.

if &amp;lt;fs&amp;gt; is not initial.
loop at &amp;lt;fs&amp;gt; assigning &amp;lt;wa&amp;gt;.
move &amp;lt;wa&amp;gt; to gt_cnj_stat.
endloop.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anybody got a clue what is wrong which the assignment ?&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;arthur de smidt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Oct 2008 14:58:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-21T14:58:40Z</dc:date>
    <item>
      <title>read memory doesn't work with badi ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659410#M1096260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a sollution in an user exit for goods movement to read the memory of the screen since I had to check the changed data before saving.&lt;/P&gt;&lt;P&gt;it works perfectly so now I thought I could also use it in a badi but somehow it doesn't work and it can't read the programm memory .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this was my code from the user exit of IW42&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: global_field_name(100).
data: artikel type structure occurs 0 with header line .

DATA: BEGIN OF gt_comp OCCURS 0.
        INCLUDE STRUCTURE cowb_comp.
DATA: END OF gt_comp.

field-symbols : &amp;lt;fs&amp;gt; type any table,
                &amp;lt;wa&amp;gt; type any.



clear global_field_name.
move '(SAPLCOWB)GT_COMP[]'  to global_field_name.
assign (global_field_name) to &amp;lt;fs&amp;gt;.


* functie moet alleen werken indien het element alwaar terugmelding op gemaakt wordt een serviceorder is
* en via totale terugmelding IW42 wordt ingevoerd
if caufvd_tab-aufnr is not initial and sy-tcode EQ 'IW42'.

loop at &amp;lt;fs&amp;gt; assigning &amp;lt;wa&amp;gt;.
move &amp;lt;wa&amp;gt; to gt_comp.
if gt_comp-rsnum eq '0'.
    message ID 'ZCS' type 'E' number '001'.
endif.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which works fantastic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I tried to translate it to the badi and it doesn't work at all. the error &amp;lt;fs&amp;gt; is not assigned is raised. somehow the trick is differently in a badi or in a method to read something from memory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the purpose is that I only need to perform the check when the status is set to AFSL&lt;/P&gt;&lt;P&gt;so I try to read the structure CNJ_STAT from memory which is the programm SAPLCJWB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: h_error type string.

data: global_field_name(100).
data: gt_cnj_stat type table of cnj_stat.

field-symbols : &amp;lt;fs&amp;gt; type any table,
                &amp;lt;wa&amp;gt; type any.



clear global_field_name.
move '(SAPLCJWB)gt_CNJ_STAT[]'  to global_field_name.
assign (global_field_name) to &amp;lt;fs&amp;gt;.

if &amp;lt;fs&amp;gt; is not initial.
loop at &amp;lt;fs&amp;gt; assigning &amp;lt;wa&amp;gt;.
move &amp;lt;wa&amp;gt; to gt_cnj_stat.
endloop.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anybody got a clue what is wrong which the assignment ?&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;arthur de smidt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 14:58:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659410#M1096260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T14:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: read memory doesn't work with badi ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659411#M1096261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Give the name of the TAB in the Upper Case. Try like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
move '(SAPLCJWB)GT_CNJ_STAT[]'  to global_field_name.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 15:03:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659411#M1096261</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2008-10-21T15:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: read memory doesn't work with badi ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659412#M1096262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i can see  here one&lt;/P&gt;&lt;P&gt;'(SAPLCJWB)gt_CNJ_STAT[]'  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this way.use all caps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;'(SAPLCJWB)GT_CNJ_STAT[]'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 15:04:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659412#M1096262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T15:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: read memory doesn't work with badi ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659413#M1096263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please do it in this way.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FIELD-SYMBOLS: &amp;lt;FS&amp;gt; TYPE ANY.
ASSIGN(')SAPLCTJDW)PSTAB') TO &amp;lt;FS&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chidanand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 15:13:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659413#M1096263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T15:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: read memory doesn't work with badi ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659414#M1096264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;nop that didn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I figured it out finally since I saw in debugging the global vars and the values of CNJ_STAT I saw that the defenition was a flat structure although I would have thouught a table would be the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so with this coding it works now &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

field-symbols : &amp;lt;fs&amp;gt; type any table,
                &amp;lt;wa&amp;gt; type any.



clear global_field_name.
move '(SAPLCJWB)CNJ_STAT'  to global_field_name.
assign (global_field_name) to &amp;lt;wa&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the input &lt;/P&gt;&lt;P&gt;arthur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 15:15:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659414#M1096264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T15:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: read memory doesn't work with badi ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659415#M1096265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why is that the way to do it Chidanand Chauhan  ? is there a reference somewhere where the recomended coding is described ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;arthur de smidt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 15:26:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-memory-doesn-t-work-with-badi/m-p/4659415#M1096265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-21T15:26:06Z</dc:date>
    </item>
  </channel>
</rss>

