def METHOD_NAME(self, query_output: dict) -> pd.DataFrame:
    """
    Function to convert the SAP output in JSON format into a dataframe.
    Args:
        query_output (dict): SAP output dictionary in JSON format that contains data rows and column headers.
    Raises:
        ValidationError: Prints the original SAP error message in case of issues with MDX execution.
    Returns:
        pd.DataFrame: Output dataframe.
    """
    raw_data = {}
    if query_output["RETURN"]["MESSAGE"] == "":
        results = query_output["DATA"]
        for cell in results:
            if cell["ROW"] not in raw_data:
                raw_data[cell["ROW"]] = {}
            if "].[" not in cell["DATA"]:
                raw_data[cell["ROW"]][cell["COLUMN"]] = cell["DATA"]
        rows = [raw_data[row] for row in raw_data]
        cols = [x["DATA"] for x in query_output["HEADER"]]
        df = pd.DataFrame(data=rows)
        df.columns = cols
    else:
        df = pd.DataFrame()
        raise ValidationError(query_output["RETURN"]["MESSAGE"])
    return df