<?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 Asset does not exist in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13627240#M2026937</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I would like to read out the activation data of an assest from transaction AS02 in Powershell, but unfortunately the scripts tells me that the asset does not exist, but when I use it in SAP GUI I find the asset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;[Reflection.Assembly]::LoadFile("C:\Windows\Microsoft.NET\assembly\GAC_64\sapnco\v4.0_3.1.0.42__50436dca5c7f7d23\sapnco.dll") &amp;gt; $Null
[Reflection.Assembly]::LoadFile("C:\Windows\Microsoft.NET\assembly\GAC_64\sapnco_utils\v4.0_3.1.0.42__50436dca5c7f7d23\sapnco_utils.dll") &amp;gt; $Null

Function Get-Destination {

      #-Connect paramters-----------------------------------------------
        
        $cfgParams = New-Object SAP.Middleware.Connector.RfcConfigParameters

        #---TEST---
        $cfgParams.Add("NAME", "SAP")
        $cfgParams.Add("ASHOST", "xx.xx.xxx.xx")

        $cfgParams.Add("SYSNR", "00")
        $cfgParams.Add("CLIENT", "100")

        $cfgParams.Add("USER", "user")
        $cfgParams.Add("PASSWD", "password")

      Return [SAP.Middleware.Connector.RfcDestinationManager]::GetDestination($cfgParams)

    }

  #-Sub Invoke-SAPFunctionModule----------------------------------------
 $destination = Get-Destination

[SAP.Middleware.Connector.IRfcFunction]$bapiChangeAsset = $destination.Repository.CreateFunction("BAPI_FIXEDASSET_GETDETAIL")

$bapiChangeAsset.SetValue("COMPANYCODE", "0001")
$bapiChangeAsset.SetValue("ASSET", "31745")

$bapiChangeAsset.Invoke($destination)

[SAP.Middleware.Connector.IRfcStructure]$return = $bapiChangeAsset.GetStructure("RETURN")
           
Write-Host $return.GetValue("MESSAGE")    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Mar 2024 14:41:30 GMT</pubDate>
    <dc:creator>Max2</dc:creator>
    <dc:date>2024-03-04T14:41:30Z</dc:date>
    <item>
      <title>Asset does not exist</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13627240#M2026937</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I would like to read out the activation data of an assest from transaction AS02 in Powershell, but unfortunately the scripts tells me that the asset does not exist, but when I use it in SAP GUI I find the asset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;[Reflection.Assembly]::LoadFile("C:\Windows\Microsoft.NET\assembly\GAC_64\sapnco\v4.0_3.1.0.42__50436dca5c7f7d23\sapnco.dll") &amp;gt; $Null
[Reflection.Assembly]::LoadFile("C:\Windows\Microsoft.NET\assembly\GAC_64\sapnco_utils\v4.0_3.1.0.42__50436dca5c7f7d23\sapnco_utils.dll") &amp;gt; $Null

Function Get-Destination {

      #-Connect paramters-----------------------------------------------
        
        $cfgParams = New-Object SAP.Middleware.Connector.RfcConfigParameters

        #---TEST---
        $cfgParams.Add("NAME", "SAP")
        $cfgParams.Add("ASHOST", "xx.xx.xxx.xx")

        $cfgParams.Add("SYSNR", "00")
        $cfgParams.Add("CLIENT", "100")

        $cfgParams.Add("USER", "user")
        $cfgParams.Add("PASSWD", "password")

      Return [SAP.Middleware.Connector.RfcDestinationManager]::GetDestination($cfgParams)

    }

  #-Sub Invoke-SAPFunctionModule----------------------------------------
 $destination = Get-Destination

[SAP.Middleware.Connector.IRfcFunction]$bapiChangeAsset = $destination.Repository.CreateFunction("BAPI_FIXEDASSET_GETDETAIL")

$bapiChangeAsset.SetValue("COMPANYCODE", "0001")
$bapiChangeAsset.SetValue("ASSET", "31745")

$bapiChangeAsset.Invoke($destination)

[SAP.Middleware.Connector.IRfcStructure]$return = $bapiChangeAsset.GetStructure("RETURN")
           
Write-Host $return.GetValue("MESSAGE")    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 14:41:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13627240#M2026937</guid>
      <dc:creator>Max2</dc:creator>
      <dc:date>2024-03-04T14:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Asset does not exist</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13627303#M2026940</link>
      <description>&lt;P&gt;You pass the asset in an external format. During SAP GUI session, it is implicitly converted to internal format, but not during background processing (without GUI)&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The domain of asset number (ANLN1) carries the ALPHA conversion exit routine.&lt;/LI&gt;&lt;LI&gt;So you can convert (on SAP size) your external format to internal format using FM&amp;nbsp;CONVERSION_EXIT_ALPHA_INPUT ('31745' -&amp;gt; '000000031745') - In your case for an external call, you should use&amp;nbsp;&lt;SPAN&gt;&lt;A title="(BAPI) Convert data from external format into internal format" href="https://me.sap.com/servicessupport/search/%7B%22q%22%3A%22BAPI_CONVERSION_EXT2INT1%22%2C%22originContext%22%3A%22CentralSearch%22%7D" target="_self"&gt;BAPI_CONVERSION_EXT2INT1&lt;/A&gt; (external to internal format convertor)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Mon, 04 Mar 2024 17:49:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13627303#M2026940</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2024-03-04T17:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Asset does not exist</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13627953#M2026948</link>
      <description>&lt;P&gt;Hey thanks for your help but online I can't find much about BAPI_CONVERSION_EXT2INT1 and on the support page also finds what helps me so I tried to delete the whole thing like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;$ItemAnlage = 31745
$ItemAnlage = "0000000" + $ItemAnlage

$destination = Get-Destination

[SAP.Middleware.Connector.IRfcFunction]$bapiChangeAsset = $destination.Repository.CreateFunction("BAPI_FIXEDASSET_GETDETAIL")

$bapiChangeAsset.SetValue("COMPANYCODE", "0001")
$bapiChangeAsset.SetValue("ASSET", $ItemAnlage)
$bapiChangeAsset.SetValue("SUBNUMBER", "0")

$bapiChangeAsset.Invoke($destination)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately this did not work and now it tells me that the attachment 000000031745 does not exist&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 09:43:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13627953#M2026948</guid>
      <dc:creator>Max2</dc:creator>
      <dc:date>2024-03-05T09:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Asset does not exist</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13628009#M2026950</link>
      <description>&lt;P&gt;Subnumber is a character field of length 4, try to replace "0" with "0000".&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 10:12:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13628009#M2026950</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2024-03-05T10:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Asset does not exist</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13628065#M2026952</link>
      <description>&lt;P&gt;Thanks, now it works&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 10:33:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13628065#M2026952</guid>
      <dc:creator>Max2</dc:creator>
      <dc:date>2024-03-05T10:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Asset does not exist</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13628075#M2026953</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Small sample in Abap for conversion BAPI external format to internal format&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;  MOVE 'BUS1022' TO CONVERSION_LS-OBJTYPE.
  MOVE 'GETDETAIL' TO CONVERSION_LS-METHOD.

  MOVE 'ASSET' TO CONVERSION_LS-PARAMETER.
  MOVE '1234' TO CONVERSION_LS-EXT_FORMAT.
  APPEND CONVERSION_LS TO CONVERSION_LT.

  MOVE 'SUBNUMBER' TO CONVERSION_LS-PARAMETER.
  MOVE '0' TO CONVERSION_LS-EXT_FORMAT.
  APPEND CONVERSION_LS TO CONVERSION_LT.

  CALL FUNCTION 'BAPI_CONVERSION_EXT2INT1'
    DESTINATION LV_BACKEND
    TABLES
      DATA   = CONVERSION_LT
      RETURN = RETURN.

    LOOP AT CONVERSION_LT INTO CONVERSION_LS.
      MOVE CONVERSION_LS-INT_FORMAT TO &amp;lt;INTVALUE&amp;gt;. " 000000001234 and 0000
      MOVE CONVERSION_LS-CONV_LEN TO &amp;lt;LENGTH&amp;gt;. " 012 et 004
    ENDLOOP.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can find the requesed values in transaction BAPI&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="raymond_giuseppi_1-1709639752368.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/75692i07B2F2E19725B014/image-size/medium?v=v2&amp;amp;px=400" role="button" title="raymond_giuseppi_1-1709639752368.png" alt="raymond_giuseppi_1-1709639752368.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="raymond_giuseppi_0-1709639747325.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/75691i229DB216B886EA8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="raymond_giuseppi_0-1709639747325.png" alt="raymond_giuseppi_0-1709639747325.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 11:56:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/asset-does-not-exist/m-p/13628075#M2026953</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2024-03-05T11:56:15Z</dc:date>
    </item>
  </channel>
</rss>

