SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Downloaden Sie, um offline zu lesen
Identifying Superior Org Units in Adhoc reporting.

How do you report on a superior organisational unit against a position that represents a group
or division within your organisation?

The scenario.

O        Company                     ABC Limited
O        Division                    Corporate Services
O        Group                       Sales and Marketing
O        Department                  Sales
O        Team                        Administration
S        Position                    Administrator
P        Person                      Fred Jones

In your Adhoc report you want to show Fred Jones works for the Sales and Marketing Group.

There are many methods how this can be achieved. Cost centre ranges for example can help
determine which group or division an employee works for or perhaps introducing the org unit
ID field with a unique naming convention.

Here is another solution you may want to consider together with your technical team.

First identify an org unit as a group within the organisation.

This can be achieved by creating a new subtype under infotype 1002 (Description) via Table
V_778U. In this example subtype 9991 was created with a subtype text of “Group”

Assign the new subtype against the org unit via transaction PO10.

Next create a customised field against the infoset you use for your Adhoc queries.

In transaction SQ02 select the infoset to be maintained.
Assuming your infoset is based on the logical database PNPCE, select the Organizational
Assignment P0001 folder then click the “extras” icon.
Create an additional field “Group” with the following characteristics:

Type C    Lngth 025      OutputLength 025         Decimals

Copy and paste the following code to this additional field:

         data: notfound(1), sobids like hrp1001-sobid, sobidm like
               hrp1001-sobid, sobida like hrp1001-sobid, psobid like
               hrp1001-sobid, stexta like hrp1000-stext.
         clear: group, sobids, sobidm, sobida, psobid, stexta.
         notfound = 'T'.
         * get the organisation unit of the employee
         select single sobid from hrp1001
         into sobida
         where otype = 'S'
         and objid = p0001-plans
         and plvar = '01'
         and endda between sy-datum and '99991231'
         and subty = 'A003'
         and sclas = 'O'.
         * check if this org unit has group marker
         perform checkifgroup using sobida changing psobid.
         * if it does, get the group name
         if sy-subrc = 0 and psobid = '9991'.
           perform getgroupname using sobida changing stexta.
           group = stexta.
         * otherwise keep sobida because sobids can change when going into the
         * loop
         else.
           sobids = sobida.
* enter the loop to find the org units above the currently selected
        * one going up the hierarchy until one is found with the group marker
        * or terminate the loop if none is found
          while notfound = 'T'.
            clear: sobidm, psobid, stexta.
            perform getsuperior using sobids changing sobidm.
        * check if the new org unit in sobidm has a record in hrp1002
            if sy-subrc = 0.
              perform checkifgroup using sobidm changing psobid.
        * if there is a record
              if sy-subrc = 0.
        * and it has a group marker
                if psobid = '9991'.
        * get the name of the group and stop looping
                  perform getgroupname using sobidm changing stexta.
                  group = stexta.
                  notfound = 'F'.
        * if no group marker is found continue with the next loop
                else.
                  sobids = sobidm.
                  continue.
                endif.
        * if no record found in hrp1002, go up to the next org unit in the
        * hierarchy using the currently selected org unit as the input to
        * the loop
              else.
                sobids = sobidm.
                continue.
              endif.
        * if no higher org unit is found, assign 'No group marker found'
        * and stop looping
            else.
              group = 'No group marker found'.
              notfound = 'F'.
            endif.
          endwhile.
        endif.

Copy and paste the following code to the free coding section:

        form getsuperior using qobjid changing qsobid.
        select single sobid from hrp1001
        into qsobid
        where otype = 'O'
        and objid = qobjid
        and plvar = '01'
        and rsign = 'A'
        and relat = '002'
        and endda = '99991231'
        and sclas = 'O'.
        endform.
        form checkifgroup using pobjid changing psobid.
        select single SUBTY from HRP1002
        into psobid
        where plvar = '01'
        and otype = 'O'
        and objid = pobjid
        and endda = '99991231'.
        endform.
        form getgroupname using sobida changing stexta.
        select single stext from hrp1000
        into stexta
        where plvar = '01'
        and otype = 'O'
        and objid = sobida
        and endda = '99991231'.
        endform.

Next drag the new field found under “Additional fields” to the Field Group/data fields folder
and generate the infoset.
The above code will then populate the additional field with the name of the org unit identified
as a group in your query. If no org unit representing a group is found the field is populated
with the text 'No group marker found'.

Weitere ähnliche Inhalte

Empfohlen

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Empfohlen (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Identifying Superior Org Units In Adhoc Reporting

  • 1. Identifying Superior Org Units in Adhoc reporting. How do you report on a superior organisational unit against a position that represents a group or division within your organisation? The scenario. O Company ABC Limited O Division Corporate Services O Group Sales and Marketing O Department Sales O Team Administration S Position Administrator P Person Fred Jones In your Adhoc report you want to show Fred Jones works for the Sales and Marketing Group. There are many methods how this can be achieved. Cost centre ranges for example can help determine which group or division an employee works for or perhaps introducing the org unit ID field with a unique naming convention. Here is another solution you may want to consider together with your technical team. First identify an org unit as a group within the organisation. This can be achieved by creating a new subtype under infotype 1002 (Description) via Table V_778U. In this example subtype 9991 was created with a subtype text of “Group” Assign the new subtype against the org unit via transaction PO10. Next create a customised field against the infoset you use for your Adhoc queries. In transaction SQ02 select the infoset to be maintained. Assuming your infoset is based on the logical database PNPCE, select the Organizational Assignment P0001 folder then click the “extras” icon. Create an additional field “Group” with the following characteristics: Type C Lngth 025 OutputLength 025 Decimals Copy and paste the following code to this additional field: data: notfound(1), sobids like hrp1001-sobid, sobidm like hrp1001-sobid, sobida like hrp1001-sobid, psobid like hrp1001-sobid, stexta like hrp1000-stext. clear: group, sobids, sobidm, sobida, psobid, stexta. notfound = 'T'. * get the organisation unit of the employee select single sobid from hrp1001 into sobida where otype = 'S' and objid = p0001-plans and plvar = '01' and endda between sy-datum and '99991231' and subty = 'A003' and sclas = 'O'. * check if this org unit has group marker perform checkifgroup using sobida changing psobid. * if it does, get the group name if sy-subrc = 0 and psobid = '9991'. perform getgroupname using sobida changing stexta. group = stexta. * otherwise keep sobida because sobids can change when going into the * loop else. sobids = sobida.
  • 2. * enter the loop to find the org units above the currently selected * one going up the hierarchy until one is found with the group marker * or terminate the loop if none is found while notfound = 'T'. clear: sobidm, psobid, stexta. perform getsuperior using sobids changing sobidm. * check if the new org unit in sobidm has a record in hrp1002 if sy-subrc = 0. perform checkifgroup using sobidm changing psobid. * if there is a record if sy-subrc = 0. * and it has a group marker if psobid = '9991'. * get the name of the group and stop looping perform getgroupname using sobidm changing stexta. group = stexta. notfound = 'F'. * if no group marker is found continue with the next loop else. sobids = sobidm. continue. endif. * if no record found in hrp1002, go up to the next org unit in the * hierarchy using the currently selected org unit as the input to * the loop else. sobids = sobidm. continue. endif. * if no higher org unit is found, assign 'No group marker found' * and stop looping else. group = 'No group marker found'. notfound = 'F'. endif. endwhile. endif. Copy and paste the following code to the free coding section: form getsuperior using qobjid changing qsobid. select single sobid from hrp1001 into qsobid where otype = 'O' and objid = qobjid and plvar = '01' and rsign = 'A' and relat = '002' and endda = '99991231' and sclas = 'O'. endform. form checkifgroup using pobjid changing psobid. select single SUBTY from HRP1002 into psobid where plvar = '01' and otype = 'O' and objid = pobjid and endda = '99991231'. endform. form getgroupname using sobida changing stexta. select single stext from hrp1000 into stexta where plvar = '01' and otype = 'O' and objid = sobida and endda = '99991231'. endform. Next drag the new field found under “Additional fields” to the Field Group/data fields folder and generate the infoset.
  • 3. The above code will then populate the additional field with the name of the org unit identified as a group in your query. If no org unit representing a group is found the field is populated with the text 'No group marker found'.